UWSpace

UWSpace is the University of Waterloo’s institutional repository for the free, secure, and long-term home of research produced by faculty, students, and staff.

Depositing Theses/Dissertations or Research to UWSpace

Are you a Graduate Student depositing your thesis to UWSpace? See our Thesis Deposit Help and UWSpace Thesis FAQ pages to learn more.

Are you a Faculty or Staff member depositing research to UWSpace? See our Waterloo Research Deposit Help and Self-Archiving pages to learn more.

Photo by Waterloo staff

Recent Submissions

  • Item type: Item ,
    Advancing Characterization of Municipal Wastewater Treatment Implications to Aquatic Phosphorus and Eutrophication in Receiving Streams
    (University of Waterloo, 2026-08-12) Nunes Vianini, Kelvin
    Municipal wastewater treatment remains a critical intervention for reducing phosphorus inputs to receiving waters and mitigating nutrient loadings to prevent eutrophication. However, treatment performance is still commonly evaluated using total phosphorus, which provides limited insight into the environmental relevance of discharged phosphorus because it does not distinguish between dissolved, particulate, reactive, and potentially bioavailable forms. This limitation is particularly important for advanced treatment systems that reduce total phosphorus but may also alter the balance and relative distribution of specific phosphorus fractions discharged to receiving waters. Under these conditions, concentration-based assessment alone may obscure whether residual phosphorus is likely to remain inert or become available after discharge. The goal of this research was to advance the characterization and interpretation of phosphorus in municipal wastewater effluents by evaluating how treatment affects phosphorus form, release behaviour, and contributions to receiving waters. Full-scale wastewater effluents were characterized across secondary and tertiary treatment configurations using solids collection, phosphorus fractionation, and controlled desorption experiments. These measurements were used to assess the composition and bioavailability of effluent particulate phosphorus, quantify changes associated with tertiary cloth filtration, evaluate phosphorus release behaviour from effluent solids in relation to established sediment-based concepts, and apply a multi-form phosphorus evaluation approach with hydrologic regime analysis to evaluate conditions under which WWTP discharges may materially influence bioavailable phosphorus concentrations post-discharge. Collectively, the findings demonstrated that wastewater phosphorus relevance depends not only on how total phosphorus is removed, but on how remaining phosphorus is partitioned and transformed after discharge. Effluent particulate phosphorus was dominated by reactive inorganic forms, indicating that residual solids can represent a bioavailable phosphorus pool rather than an inert particulate fraction. Tertiary treatment reduced total and particulate phosphorus and lowered the release potential of effluent solids, but did not eliminate dissolved phosphorus inputs or the capacity of remaining solids to act as phosphorus sources. Desorption behaviour was highly influenced by temperature, while pH effects were most evident outside circumneutral conditions. When these experimentally derived behaviours were evaluated under receiving water conditions, the contribution of bioavailable phosphorus was controlled strongly by dilution, background phosphorus concentration, and effluent flow. This thesis demonstrates that total phosphorus removal alone is insufficient to characterize eutrophication-relevant wastewater performance. A more complete assessment requires explicit consideration of phosphorus speciation, particulate phosphorus bioavailability and post-discharge release, and receiving water context. By linking treatment performance to phosphorus form and flow patterns, this work provides a stronger basis for interpreting wastewater phosphorus controls in relation to downstream bioavailable phosphorus exposure, without assuming that concentration changes alone directly predict ecological response.
  • Item type: Item ,
    Multilingual Embeddings: Data, Training, and Understanding
    (University of Waterloo, 2026-08-12) Zhang, Xinyu
    Embedding models have been a central component of modern information access systems, including search engines, question answering systems, retrieval-augmented generation, and nowadays agentic search pipelines. By converting text-space search into vector-space search, embedding models provide semantic matching beyond exact lexical overlap. However, their progress has been uneven across languages. While English dense retrieval has benefited from large training collections, mature benchmarks, and well-studied training recipes, many other languages still lack reliable retrieval resources, practical modeling guidance, and a clear understanding of why multilingual transfer works. This thesis studies multilingual embedding models for retrieval from three connected perspectives: data, training, and understanding. First, it introduces two multilingual retrieval resources, Mr. TYDI and MIRACL. Mr. TYDI establishes the first large-scale mono-lingual retrieval benchmark over eleven typologically diverse languages, while MIRACL expands the setting to eighteen languages with ten times richer human relevance annotations. Together, these datasets provide both the supervision needed to train multilingual dense retrievers and the benchmarks needed to evaluate them reliably across diverse languages and scripts. Second, we investigate how to train multilingual dense retrievers under realistic resource conditions. Starting from the observation that plain multilingual DPR can perform only marginally better than BM25 in unsupervised settings, this part studies cases where target-language training data, target-language pretrained models, or both may be unavailable. The analysis compares pretrained backbones, translated and in-language data, multi-stage fine-tuning, cross-lingual transfer, knowledge distillation, and monolingual versus multilingual transformers. These experiments provide practical guidance for building effective multilingual retrieval models when resources differ across languages. Third, this thesis examines how multilingual language models may understand across languages. It analyzes the roles of shared tokens across languages and their impact at the embedding finetuning stage, and then examines how language models may understand token-level semantic concepts, revealing that multilingual understanding and cross-lingual transfer largely depend on token-level semantic structures within multilingual vocabularies and embedding spaces. Overall, this thesis contributes datasets, training strategies, and model analyses that move multilingual retrieval research from infrastructure to practice to interpretation, advancing the development of retrieval systems that can support information access more reliably across languages, scripts, and resource conditions.
  • Item type: Item ,
    Transitioning to Explicit Nulls in Scala
    (University of Waterloo, 2026-08-12) Lau, Harris
    Scala, being a language that compiles to the JVM, suffers from the problem that JVM bytecode references are implicitly nullable. Every dereference is therefore a potential null pointer exception. Scala's explicit nulls system removes this hazard at the type level: the null type is no longer a subtype of the reference types, and a nullable value must be declared as a union of its base type with null. The change is sound, but it is also global, and it invalidates a large body of existing Scala code as well as every assumption that Scala programs make about the nullability of the Java libraries they call. A null-safe type system that nobody migrates to is of little use, so the practical question is not whether explicit nulls is correct, but whether the ecosystem can be moved onto it. This thesis describes and evaluates the four compatibility features that the Scala compiler provides to answer that question. The non-null cast lets a programmer assert non-nullness at a use site, using an intersection with a singleton type to preserve path-dependent typing. Flow typing tracks, for each block of code, a pair of asserted and retracted variable sets composed by sequencing and alternation operators, with a distinguished value for blocks that always terminate abruptly; this admits the common idiom of checking a variable against null before dereferencing it. Flexible types give a value obtained from Java a deliberately unsound pair of bounds that allows it to be used as either nullable or non-nullable, resolving an interoperation problem that neither a fully sound nor a fully permissive translation of Java types can solve for invariant type constructors such as arrays. Finally, the unsafe nulls language import relaxes null-related type checking within a lexical scope, and its counterpart safe nulls restores it, allowing null safety to be adopted incrementally at the granularity of a project, a file, or a single block. We evaluate these features on two sets of real Scala projects. On the Community Build of 40 widely used libraries, 15 compile under explicit nulls with no changes at all; among the rest, most of the porting effort consists of widening declared types to nullable unions (45% of changed lines) and inserting non-null assertions (23%). An ablation study shows that flow typing and flexible types each carry a substantial and non-overlapping share of the migration burden: disabling flow typing surfaces 424 additional compilation errors across 17 projects, while disabling flexible types surfaces 1,579 across 31 projects. The two features are orthogonal, flow typing addressing null checks within Scala code and flexible types addressing values obtained from Java, and neither substitutes for the other. On the Open Community Build of 1,928 projects, enabling explicit nulls alone causes 854 projects to fail to compile; enabling it together with unsafe nulls reduces this to 16, a compatibility rate of 99.17%, with the remaining failures confined to two narrow and well-understood causes. These results indicate that explicit nulls, taken together with its compatibility features, is mature enough to be enabled by default in a future major release of the Scala compiler.
  • Item type: Item ,
    Chromium Stable Isotope Fractionation During Reduction of Hexavalent Chromium by Zero-valent Iron and Biochar
    (University of Waterloo, 2026-08-12) Budimir, Filip
    Chromium, particularly in its toxic hexavalent form, represents a severe environmental and public health hazard due to its high mobility, persistence in groundwater systems, and well-documented carcinogenicity. Industrial activities such as electroplating, leather tanning, and mining operations have led to widespread Cr(VI) contamination of aquatic systems, where it poses risks to both ecosystems and human populations through drinking water exposure. Unlike Cr(III), which is less soluble and a micro-nutrient, Cr(VI) readily migrates through subsurface environments, making its containment and remediation particularly challenging. A critical advancement in addressing Cr(VI) contamination lies in the application of chromium stable isotopes as powerful diagnostic tools for tracking remediation processes. Isotopic fractionation provides unique insights into the mechanisms and efficiency of Cr(VI) removal, distinguishing between physical adsorption, chemical reduction, and diffusion-limited processes. This approach enables researchers and practitioners to quantify reaction progress in real-world remediation systems and identify rate-limiting steps in contaminant transformation. The study investigates Cr(VI) removal by zero-valent iron (ZVI) under dynamic flow conditions, systematically evaluating the influence of ZVI quantity on reaction mechanisms and isotope fractionation. Reactive transport modeling (MIN3P) was employed to validate the conceptual framework of Cr(VI) reduction by ZVI, revealing a dual-stage removal process. Isotope fractionation adheres to a dual Rayleigh model, with distinct enrichment factors for each stage: the first dominated by direct Cr(VI) reduction by ZVI (ε = −1.2‰), and the second controlled by aqueous Fe(II)-mediated reduction (ε = −3.5‰). Kinetic parameters were optimized to unify the model across three ZVI scenarios, demonstrating how variable reactive surface areas influence removal efficiency and isotopic signatures. These results underscore the interplay between ZVI mass transport limitations and redox-driven fractionation in flow-through systems. This study also examines Cr(VI) removal under static conditions, demonstrating that oak-based biochar achieves near-complete (99%) elimination of Cr(VI) from solution at low pH. Advanced characterization techniques, including X-ray photoelectron spectroscopy (XPS) and synchrotron-based X-ray absorption spectroscopy (XANES), confirm that Cr(VI) is both adsorbed onto the biochar surface and reduced to less toxic Cr(III). Fourier-transform infrared (FTIR) spectroscopy reveals that aliphatic and aromatic functional groups play a key role in the removal process. Chromium isotope analysis shows fractionation occurs during the removal process, with lighter isotopes preferentially removed, following a single Rayleigh model (ε = −1.33‰). These findings highlight the dual role of biochar as a sorbent and reductant, with isotope fractionation serving as a diagnostic tool for tracking reaction progress. The study then investigates Cr(VI) removal under dynamic, saturated flow conditions, simulating real-world scenarios such as transport through permeable reactive barriers. Unlike the batch system, the flow-through experiment reveals a two-stage removal process: initial sorption and diffusion (ε = −1.01‰) followed by reduction (ε = −3.19‰), as indicated by a dual Rayleigh model. XANES analysis confirms that Cr(III) dominates (75–85%) but residual Cr(VI) (15–25%) persists, indicating ongoing sorption with reduction. The study contrasts the isotope fractionation under flow conditions with the static batch system, emphasizing how hydrodynamic conditions influence removal mechanisms and isotope fractionation. These findings have critical implications for designing and monitoring remediation strategies. The dominance of reduction pathways in biochar systems suggests the potential utility in passive treatment systems. Isotope fractionation could track long-term performance. For ZVI-based technologies (e.g., permeable reactive barriers), the identification of dual removal mechanisms and intraparticle heterogeneity demonstrates the need to optimize reactive surface availability and residence times. The consistency of isotope fractionation patterns across systems is consistent with use as a diagnostic tool to distinguish between adsorption, diffusion-limited, and redox-driven removal in field applications. Future work could extend these insights to multicomponent contaminant systems or field-scale validation, bridging the gap between mechanistic studies and real-world implementation.
  • Item type: Item ,
    Learning at Test Time: Adapting Models with Synthetic Data and Environment Interaction
    (University of Waterloo, 2026-08-12) Chen, Haonan
    Machine learning models are trained before deployment, yet the context they are deployed into—the data distribution they will serve, or the environment they will act in—is often unavailable during training. This thesis studies test-time context mismatch: the setting in which information needed for reliable model behavior is only revealed at deployment time. It investigates how two kinds of test-time information, limited unannotated real data and environment interaction, can be converted into signals for adaptation. The first contribution addresses mismatch in the training data. We introduce and formalize Synthetic Dataset Quality Estimation (SynQuE), the problem of ranking synthetic datasets by their expected real-world task performance using only limited unannotated real data. We establish the first comprehensive benchmark for this problem by adapting distribution- and diversity-based distance measures as proxy metrics, and we propose Lens, a novel proxy that leverages large language model (LLM) reasoning to characterize the differences between synthetic and real data through natural-language rubrics. Across sentiment analysis, text-to-SQL parsing, image classification, and web navigation, SynQuE proxies correlate with real task performance; on text-to-SQL, selecting the top-3 synthetic datasets by proxy score raises accuracy from 30.4% to 38.4% on average over indiscriminate selection, and Lens consistently outperforms other proxies on complex, long-horizon tasks. The second contribution addresses mismatch in the deployment environment. We identify two failure modes of LLM agents in novel environments—syntactic misunderstanding of environment-specific formats and semantic misunderstanding of state-transition dynamics—and propose an annotation-free adaptation strategy for each. Online syntactic alignment learns a lightweight adaptation vector during deployment that aligns the agent’s output distribution with the environment’s syntax at roughly 3% latency overhead. Deployment-time dynamics grounding uses persona-driven exploration to build an in-context world model of the environment’s causal dynamics before task execution. Both strategies improve performance across function-calling and web-navigation benchmarks; on the WebArena multi-site split, dynamics grounding raises the agent’s success rate from 2% to 23%. Finally, the thesis develops a unified view of these two adaptation routes, comparing the signals they consume and the timescales they operate on, and showing that both replace labeled supervision with structure available at test time. This view positions test-time context as a practical resource for adaptation precisely in the privacy-sensitive and low-resource settings where labels, demonstrations, and retraining are unavailable.