Computer Science
Permanent URI for this collectionhttps://uwspace.uwaterloo.ca/handle/10012/9930
This is the collection for the University of Waterloo's Cheriton School of Computer Science.
Research outputs are organized by type (eg. Master Thesis, Article, Conference Paper).
Waterloo faculty, students, and staff can contact us or visit the UWSpace guide to learn more about depositing their research.
Browse
Recent Submissions
Item Symbols, Dynamics, and Maps: A Neurosymbolic Approach to Spatial Cognition(University of Waterloo, 2025-03-12) Dumont, Nicole Sandra-Yaffa; Eliasmith, Chris; Orchard, JeffThe discovery of various spatially sensitive neurons in the hippocampal formation, such as place, grid, and boundary cells, has provided valuable insights into the neural mechanisms underlying spatial representation and navigation. However, neural activity and connectivity data alone cannot fully reveal the brain’s algorithms. Bridging this gap requires computational models that not only explain the low-level activity of spatially sensitive cells but also link it to higher-level symbolic representations manipulable within a cognitive framework – models capable of binding spatial representations to discrete abstractions, while also supporting hierarchical and probabilistic structures that enable reasoning and decision-making. The Semantic Pointer Architecture (SPA; Eliasmith, 2013), in combination with the Neural Engineering Framework (NEF; Eliasmith et al., 2003), provides a mathematical and computational framework to represent symbols and implement dynamical systems in spiking neural networks. Spatial Semantic Pointers (SSPs; Komer et al., 2019), an extension to the SPA, encode continuous variables, such as spatial locations, while supporting the binding of spatial information with other features – continuous or discrete – into compressed, multi-domain representations. This flexibility allows SSPs to model diverse cognitive processes, ranging from spatial memory to abstract reasoning, offering a unified theory for how continuous variables might be represented and manipulated in the brain. In this thesis, we leverage these tools to model key components of spatial cognition, including path integration, cognitive map creation, and reinforcement learning. Our contributions include the development of SSP-PI, a SSP-based path integration model that combines velocity controlled oscillators with attractor dynamics to integrate continuous spatial variables. We also introduce SSP-SLAM, a biologically inspired spiking neural SLAM system capable of constructing semantic cognitive maps that bind and associate spatial and non spatial features. Furthermore, we propose spiking RL models that demonstrate how SSP embeddings can effectively represent successor features, reward distributions, and stochastic policies. Finally, we use the SPA and SSPs to construct state embeddings for deep RL networks, demonstrating their utility in tasks requiring mixed semantic-spatial representations. Our findings underscore the potential of SSPs to act as a unifying framework for understanding spatial representation in the brain while advancing biologically inspired approaches to navigation and learning in artificial systems. This work bridges theoretical neuroscience and artificial intelligence, laying the groundwork for future explorations of shared principles across spatial and abstract cognition.Item Perspectives of Graph Diffusion: Computation, Local Partitioning, Statistical Recovery, and Applications(University of Waterloo, 2025-03-06) Yang, Shenghao; Fountoulakis, KimonDiffusion describes the process of mass moving from one region to another. In the con- text of graph, the diffusing mass spreads from nodes to nodes along the edges of the graph. Broadly speaking, this includes a number of stochastic and deterministic processes such as random walk, heat diffusion, network flow and electrical flow on graphs. Graph diffusion is a highly important primitive, and has been shown to have a variety of surprising properties both theoretically and practically. In this thesis, we present several new perspectives of graph diffusion, with an emphasis on how diffusion algorithms uncover the local clustering structure of the input data without necessarily exploring the entire graph. In the first two parts of the thesis, we introduce a new class of graph diffusion methods that are provably better at extracting the local clustering structure of a graph or a hy- pergraph. Here, diffusion is formulated as a pair of primal and dual convex optimization problems, based on the idea of spreading mass in the graph while minimizing a p-norm net- work flow cost. The primal solution of the diffusion problem provides an intuitive physical interpretation where paint (i.e. mass) spills from the source nodes, spreads over the graph, and there is a sink at each node where up to a certain amount of paint can settle. The dual solution embeds the nodes on the non-negative real line and is considered as the output of diffusion. We will show that the dual variables nicely encode the local clustering structure around a given set of seed nodes. In particular, assume the existence of a cluster C of low conductance Φ(C), the sweep cut procedure on the dual variables returns a cluster whose conductance is not too much larger than Φ(C). In the next two parts of the thesis, we introduce a weighted diffusion mechanism which allows any existing diffusion method to take into account additional node information such as node attributes and labels. The method weighs the edges of the graph based on the attributes or the labels of each node. Depending on the nature and availability of additional node information, two simple yet effective edge-weighting schemes are introduced and analyzed. Over contextual random graphs generated by a local variant of the stochastic block model with noisy node information, we will show that, if the additional information contains enough signal about the ground-truth cluster, then employing existing diffusion algorithms in the weighted graph can more accurately recover the ground-truth cluster than employing diffusion in the original graph without edge weights. In particular, statistical recovery guarantees in terms of precision and F1 score will be derived and compared. All of the results are supplemented with extensive experiments on both synthetic and real-world data to illustrate the technical results and the effectiveness of the new methods in practice. The code is open-source on GitHub.Item Operating Systems are a Service(University of Waterloo, 2025-03-05) Hancock, Kenneth; Mashtizadeh, AliOS containers have set the standard for the deployment of applications in modern systems. OS containers are combined sandboxes/manifests of applications that isolate the running applications and its dependencies from other applications running on top of the same kernel. Containers make it easy to provide multi-tenancy and control over the application, making it ideal for use within cloud architectures such as serverless. This thesis explores and develops novel systems to address three problems faced by containers and the services that use them. First, OS containers currently lack a fast checkpoint-restore mechanism. Second, container security is still inadequate due to its underlying security mechanisms, which provide coarse-grained policies that are abused. Third, the lack of a benchmark for serverless clouds, one of the largest consumers of containers, and specifically checkpoint-restore. This thesis outlines solutions to these problems. First, ObjSnap, a storage system designed and built for two modern single-level store systems, Aurora and MemSnap, which enable checkpoint restore for container systems. ObjSnap is a transactional copy-on-write object store that can outperform other storage systems by up to 4×. Second, we introduce SlimSys, a framework that tackles security issues found within containers by binding a policy to kernel resources. Lastly, we introduce Orcbench, the first benchmark used to evaluate serverless orchestrators.Item A First-Principles Framework for Simulating Light and Snow Interactions(University of Waterloo, 2025-02-25) Varsa, Petri Matthew; Baranoski, GladimirInteractions between light and matter give rise to an abundance of natural phenomena. Common examples include those between light and atmospheric ice crystals producing halos, and between light and liquid water droplets producing rainbows. However, interesting effects may also be observed when light impinges upon more dense materials such as snow. These may be noted as changes to the appearance of the material resulting from variations in the characteristics of the material itself. In some cases, these appearance changes may even manifest themselves as dramatic changes in colour. In this thesis, we study snow as a material and reproduce such phenomena by simulating light interactions with virtual snow samples. Accordingly, this work presents a first-principles framework for simulating light transport through snow. Data and information that describe the characteristics of snowpacks are obtained from the literature and used to devise a digital representation of them suitable for predicatively modelling light interactions with snow. The employed formulation allows for different virtual snow samples to be investigated. Simulated rays of light are cast into a virtual snow sample, and these rays are reflected and refracted until they exit from the surface of the sample, are transmitted through the sample or are absorbed. The modelling results are recorded as spectral response datasets for evaluation and analysis. These datasets are then compared with measured data and observations reported in the literature in order to assess the simulations’ fidelity. There are a number of study areas where such a framework can make a contribution. In this thesis, we discuss such contributions to two fields of research, namely, computer graphics and remote sensing. From a computer graphics perspective, the outputs of simulating light interactions with snow may be used in natural phenomena visualizations employed for educational and entertainment purposes. From a remote sensing perspective, the simulations may be used to conduct in silico experiments that help to shed light on topics that are actively being studied. Furthermore, the simulation outputs may also be used as data products in themselves, to make comparisons against remotely acquired data and support other modelling initiatives. The proposed framework presented in this thesis encapsulates a body of work that is expected to advance the state of the art of snow appearance modelling using a multi-faceted approach. The foundation of the framework is a novel radiative transfer model of light impingement on snow, whose predictive capabilities are extensively evaluated. Then, data products produced by this framework are used to address open questions in the two fields of interest, i.e., computer graphics and remote sensing. In particular, we describe a method to include the complex, visual phenomena that are predicted by the radiative transfer model introduced here into a traditional rendering pipeline. We also make use of the proposed framework to investigate open problems (e.g., the absorption of solar radiation by snow and the effect that this has on avalanche prediction) with potential interdisciplinary applications.Item Reweighted Eigenvalues: A New Approach to Spectral Theory beyond Undirected Graphs(University of Waterloo, 2025-02-21) Tung, Kam Chuen; Lau, Lap ChiWe develop a concept called reweighted eigenvalues, to extend spectral graph theory beyond undirected graphs. Our main motivation is to derive Cheeger inequalities and spectral rounding algorithms for a general class of graph expansion problems, including vertex expansion and edge conductance in directed graphs and hypergraphs. The goal is to have a unified approach to achieve the best known results in all these settings. The first main result is an optimal Cheeger inequality for undirected vertex expansion. Our result connects (i) reweighted eigenvalues, (ii) vertex expansion, and (iii) fastest mixing time [BDX04] of graphs, similar to the way the classical theory connects (i) Laplacian eigenvalues, (ii) edge conductance, and (iii) mixing time of graphs. We also obtain close analogues of several interesting generalizations of Cheeger’s inequality [Tre09, LOT12, LRTV12, KLLOT13] using higher reweighted eigenvalues, many of which were previously unknown. The second main result is Cheeger inequalities for directed graphs. The idea of Eulerian reweighting is used to effectively reduce these directed expansion problems to the basic setting of edge conductance in undirected graphs. Our result connects (i) Eulerian reweighted eigenvalues, (ii) directed vertex expansion, and (iii) fastest mixing time of directed graphs. This provides the first combinatorial characterization of fastest mixing time of general (non-reversible) Markov chains. Another application is to use Eulerian reweighted eigenvalues to certify that a directed graph is an expander graph. Several additional results are developed to support this theory. One class of results is to show that adding $\ell_2^2$ triangle inequalities [ARV09] to reweighted eigenvalues provides simpler semidefinite programming relaxations, that achieve or improve upon the previous best approximations for a general class of expansion problems. These include edge expansion and vertex expansion in directed graphs and hypergraphs, as well as multi-way variations of some undirected expansion problems. Another class of results is to prove upper bounds on reweighted eigenvalues for special classes of graphs, including planar, bounded genus, and minor free graphs. These provide the best known spectral partitioning algorithm for finding balanced separators, improving upon previous algorithms and analyses [ST96, BLR10, KLPT11] using ordinary Laplacian eigenvalues.Item A Study of the Opportunities and Challenges of Using Edge Computing to Accelerate Cloud Applications(University of Waterloo, 2025-02-18) Qadi, Hala; Al-Kiswany, SamerI explore the viability of using edge clusters to host latency-sensitive applications and to run services that can improve end-to-end communication performance across both wide area networks (WANs) and 5G environments. The study examines the viability of using edge clusters in three scenarios: accelerating TCP communications through TCP splitting in 5G deployments, hosting an entire application-level service or the latency-sensitive part of an application on an edge cluster, and deploying a TCP splitting service on edge clusters to support WAN communication. I explore these scenarios while varying packet drop rates, communication stacks, congestion control protocols, and TCP buffer sizes. My findings bring new insights about these deployment scenarios. I show that edge computing, especially through TCP splitting, can significantly improve end-to-end communication performance over the classical communication stack. TCP splitting over the 5G communication stack does not bring any benefit and can reduce throughput. This is because of the unique characteristics of the 5G communication stack. Furthermore, over the classical communication stack, TCP splitting brings higher benefit for flows larger than 64 KB. These findings provide valuable insights into how edge clusters can accelerate TCP communication in different network environments and identify high-impact research ideas for future work.Item The Power of Experimental Approaches to Social Choice(University of Waterloo, 2025-02-14) Armstrong, Ben; Larson, KateWith increasing connectivity between humans and the rise of autonomous agents, group decision-making scenarios are becoming ever more commonplace. Simultaneously, the requirements placed upon decision-making procedures grow increasingly nuanced as social choices are made in more niche settings. To support these demands, a deeper understanding of the behaviour of social choice procedures is needed. The standard theoretical approach to analyze social choice procedures is limited in the type of question it can answer. Theoretical analyses can be rigid: It may speak to the incompatibility of different properties without also providing a deeper understanding of the properties themselves, or might stop at proving the worst-case outcome of a voting rule without communicating the rule's typical behaviour. In this dissertation, we address these limitations by demonstrating that experimental analysis of social choice domains can provide an understanding of social choice which is both complementary and additional to theoretical findings. In particular, experimental approaches can form a middle ground between theory and practice: more practical than theoretical approaches in a setting more controlled than real-world application. We apply this approach to a new form of delegative voting and to a task of learning existing and novel voting rules. In each area we find results of a type and scale which are infeasible to traditional analysis. We first examine an abstract model of delegative voting -- agents use liquid democracy to transitively delegate their vote -- in a setting where the voters collectively agree on a correct outcome. Through extensive simulations we show the dynamic effects on group accuracy from varying a wide range of parameters that collectively encompass many types of human behaviour. We identify two features of this paradigm which result in improvements to group accuracy and highlight a possible explanation for their effectiveness. Subsequently, we apply this liquid democracy framework to the process of training an ensemble of classifiers. We show that the experimental findings from our simulations are largely maintained on a task involving real-world data and result in further improvements when considering a novel metric of the training cost of ensembles. Additionally, we demonstrate the creation of a robust framework for axiomatic comparison of arbitrary voting rules. Rather than proving whether individual rules satisfy particular axioms, we establish a framework for showing experimentally the degree to which rules general satisfy sets of axioms. This enables a new type of question -- degrees of axiom satisfaction -- and provides a clear example of how to compare a wide range of single and multi-winner voting rules. Using this framework, we develop a procedure for training a model to act as a novel voting rule. This results in a trained model which realizes a far lower axiomatic violation rate than most existing rules and demonstrates the possibility for new rules which provide superior axiomatic properties.Item Large Language Models for Build System Maintenance: An Empirical Study of CodeGen’s Next-Line Prediction(University of Waterloo, 2025-01-31) Akin-Taylor, Akinbowale; McIntosh, Shane; Nagappan, MeiyappanBuild systems play a crucial role in software development and are responsible for compiling source code into executable programs. Despite their importance, build systems often receive limited attention because their impact is not directly visible to end users. This oversight can lead to inadequate maintenance, frequent build failures, and disruptions that require additional resources. Recognising and addressing the maintenance needs of build systems is essential to preventing costly disruptions and ensuring efficient software production. In this thesis, I explore whether applying a Large Language Model (LLM) can reduce the burden of maintaining build systems. I aim to determine whether the prior content in build specifications provides sufficient context for an LLM to generate subsequent lines accurately. I conduct an empirical study on CodeGen, a state-of-the-art Large Language Model (LLM), using a dataset of 13,343 Maven build files. The dataset consists of the Expert dataset from the Apache Software Foundation (ASF) for fine-tuning (9,426 build files) and the Generalised dataset from GitHub for testing (3,917 build files). I observe that (i) fine-tuning on a small portion of data (i.e., 11% of fine-tuning datasets) provides the largest improvement in performance by 13.93% (ii) When applied to the Generalised dataset, the fine-tuned model retains 83.86% of its performance, indicating that it is not overfitted. Upon further investigation, I classify build-code content into functional and metadata subgroups based on enclosing tags. The fine-tuned model performs substantially better in suggesting functional than metadata build-code. The findings highlight the potential of leveraging LLMs like CodeGen to relieve the maintenance challenges associated with build systems, particularly in functional content. My thesis highlights the limitations of large language models in suggesting the metadata components of build code. Future research should focus on developing approaches to enhance the accuracy and effectiveness of metadata generation.Item Analyzing Access Control logic in the Android Automotive Framework(University of Waterloo, 2025-01-30) Jumana, .; Aafer, YousraThe Android Automotive Operating System (AAOS) is a specialized version of the Android OS designed specifically for in-vehicle hardware. Prominent car manufacturers, including Honda, General Motors (GM), Volvo, and Ford have already adopted it, with Porsche planning to follow soon. Despite its popularity, little has been done to evaluate the security of AAOS integration, particularly at the framework layer where access control vulnerabilities are likely to arise. To bridge the gap, we perform the first security evaluation of automotive APIs in AAOS. Our study is enabled by AutoAcRaptor, an automated tool that identifies automotive-specific entry points, generates their access control specifications, and analyzes them for potential security risks. AutoAcRaptor leverages static analysis and NLP to perform a three-staged analysis pipeline: 1) Convergence Analysis, 2) Similarity Analysis, and 3) Cross-Image Analysis. Our evaluation demonstrates that the tool is able to efficiently focus the security analysis on auto-specific functionality and pinpoint automotive APIs with likely anomalous access control.Item A Survival-Driven Machine Learning Framework for Donor-Recipient Matching in Liver Transplantation: Predictive Ranking and Optimal Donor Profiling(University of Waterloo, 2025-01-27) Wang, Yingke; He, Xi; Rambhatla, SirishaLiver transplantation is a life-saving treatment for patients with end-stage liver disease. However, donor organ scarcity and patient heterogeneity make finding the optimal donor-recipient matching a persistent challenge. Existing models and clinical scores are shown to be ineffective for large national datasets such as the United Network for Organ Sharing (UNOS). In this study, I present a comprehensive machine-learning-based approach to predict posttransplant survival probabilities at discrete clinical important time points and to derive a ranking score for donor-recipient compatibility. Furthermore, I developed a recipient-specific "optimal donor profile," enabling clinicians to quickly compare waiting-list patients to their ideal standard, streamlining allocation decisions. Empirical results demonstrate that my score’s discriminative performance outperforms traditional methods while maintaining clinical interpretability. I further validate that the top compatibility list generated by our proposed scoring method is non-trivial, demonstrating statistically significant differences from the list produced by the traditional approach. By integrating these advances into a cohesive framework, our approach supports more nuanced donor-recipient matching and facilitates practical decision-making in real-world clinical settings.Item Type-Safe Tree Transformations for Precisely-Typed Compilers(University of Waterloo, 2025-01-23) Magnan Cavalcante Oliveira, Pedro Jorge; Lhoták, OndřejCompilers translate programs from a source language to a target language. This can be done by translating into an intermediate tree representation, performing multiple partial transformations on the tree, and translating out. Compiler implementers must choose between encoding transformation invariants with multiple tree types at the cost of code boilerplate and duplication, or forgoing static correctness by using a broad and imprecise tree datatype. This thesis proposes a new approach to writing precisely-typed compilers and tree transformations without code boilerplate or duplication. The approach requires encoding the tree nodes using two type indices, one for the phase of the root node and another for the phase of all children nodes. This tree datatype can represent partially transformed nodes, and distinguish between trees of different phases. In order to make this approach possible it was necessary to modify the Scala type checker to better infer types in ‘match’-expressions. Precisely-typed tree transformations make use of the default case of a ‘match’-expression; this case must be elaborated to a type which is the type difference of the scrutinee expression and all previously matched patterns. We demonstrate the viability of this approach by implementing a case study for a precisely-typed compiler for the instructional language Lacs. This case study modifies the existing implementation of Lacs to track which subset of tree nodes may be present before and after any given tree transformation. We show that this approach can increase static correctness without the burden of additional code boilerplate or duplication.Item Secure and Efficient Message Routing and Delivery Across Blockchain Networks(University of Waterloo, 2025-01-22) Davidson, Solomon; Wong, BernardThe increasing demand for blockchain applications and services has led to a surge of new public blockchains to support this growth. Although the availability of additional blockchains enables the support of more applications and users, it also fragments liquidity, which can create a challenging user experience. Cross-chain communications can tackle this issue by providing interoperability for smart contracts across blockchains. However, current cross-chain delivery solutions either only support message passing between directly connected chains, which significantly limits their connectivity, or are heavily centralized, requiring messages to be routed through a single hub chain. In this thesis, we present Baton, an interoperability protocol for efficient and secure cross-chain message routing and delivery. Baton is built on the Inter-Blockchain Communication protocol (IBC). IBC is a protocol for general message passing between blockchains. Developers independently connect chains over IBC as they see fit, and Baton can route messages across the IBC topology to allow pairs of chains to communicate. This reduces the need for additional trusted connection setup periods, which are vulnerable for exploitation. Routes are computed off-chain and verified on-chain to minimize the cost of route computation. Unlike IBC, where users must manually specify routes, users can send cross-chain messages just by specifying a destination chain. Baton enforces cryptoeconomic incentives to ensure that near-optimal routes, based on a user specified metric, are maintained. Unlike packet routing in traditional networks where the packets have to traverse one or more transit networks, Baton delivers messages directly from the source to the destination and only uses the state of the intermediate chains to construct a proof to verify the authenticity of the message. Baton can also include information about chain security properties within these proofs, such as how stake is distributed. These user-specified security policies disallow messages from being sent along routes with less secure blockchains. Baton can send messages along multiple disjoint paths that connect the same chains. By verifying that messages sent along disjoint paths are the same, Baton can detect compromised chains and fabricated messages. Cosmos Hub and Axelar are hub chains that connect to other blockchains, and that enable wide-spread interoperability by forwarding messages between pairs of chains. If Cosmos Hub or Axelar become unavailable, only 32.8% and 48.2% of chain pairs can communicate, respectively. In contrast, Baton can maintain connectivity between 57.5% of chain pairs when the top 10 most connected blockchains become unavailable. Our evaluation shows that Baton can deliver up to 20.6% and 3.26% more messages than if blockchains were arranged in a mesh topology or a hub-and-spoke topology respectively, given the same number of cross-chain proof transactions.Item SWE-bench-secret: Automating AI Agent Evaluation for Software Engineering Tasks(University of Waterloo, 2025-01-21) Kio, Godsfavour; Nagappan, MeiyappanThe rise of large language models (LLMs) has sparked significant interest in their application to software engineering tasks. However, as new and more capable LLMs emerge, existing evaluation benchmarks (such as HumanEval and MBPP) are no longer sufficient for gauging their potential. While benchmarks like SWE-bench and SWE-bench-java provide a foundation for evaluating these models on real-world challenges, publicly available datasets face potential contamination risks, compromising their reliability for assessing generalization. To address these limitations, we introduce SWE-bench-secret, a private dataset carefully selected to evaluate AI agents on software engineering tasks spanning multiple years, including some originating after the models’ training data cutoff. Derived from three popular GitHub repositories, it comprises 457 task instances designed to mirror SWE-bench’s structure while maintaining strict data secrecy. Evaluations on a lightweight subset, called SWE-Secret-Lite, reveal significant performance gaps between public and private datasets, highlighting the increased difficulty models face when dealing with tasks that extend beyond familiar patterns found in publicly available data. Additionally, we provide a secure mechanism that allows researchers to submit their agents for evaluation without exposing the dataset. Our findings emphasize the need for improved logical reasoning and adaptability in AI agents, particularly when confronted with tasks that lie outside well-known public training data distributions. By introducing a contamination-free evaluation framework and a novel secret benchmark, this work strengthens the foundation for advancing benchmarking methodologies and promoting the development of more versatile, context-aware AI agents.Item Exploring high-level transport programming through eXpress Data Path(University of Waterloo, 2025-01-20) Valenca Mizuno, Pedro Vitor; Tahmasbi Arashloo, MinaThe transport layer is a layer from the network stack responsible for providing several essential services, such as congestion control, and lost packet detection and retransmission. Moreover, this layer is constantly changing to satisfy the new demands present in the network. This includes the increase in traffic, the leveraging of new hardware, and the release of new workloads. However, implementing these protocols is a considerably challenging task due to several reasons. First, the available documentation about these algorithms is written in natural language and can be long, which may result in misinterpretations, and consequently, incorrect implementations. Second, while developing transport algorithms, programmers must deeply study the environment where the protocol will run to find the best-suiting built-in helper functions and data structures available for their implementations. For this reason, the protocols are usually implemented as large sections of optimized code that are challenging to navigate, read, and modify. Third, since the transport layer is located between two other layers, namely application and network, transport algorithms must handle the details of these interactions, which can depend on the execution environment. In this thesis, we introduce Modular Transport Programming (MTP). This event-driven framework allows the declaration of transport algorithms with a high-level, yet, precise language. MTP abstracts low-level details by providing a set of high-level built-in functions and constructs focused solely on transport programming. It also abstracts the interactions between the transport layer and its neighbours by having interfaces responsible for such communication. Moreover, it improves the readability of MTP code by having a modularized design that clearly shows how each module interacts with the other and how the events are processed. To explore the feasibility and effectiveness of MTP, we chose to implement transport protocols in the Linux Kernel. The Linux Kernel and its transport layer implementations are some of the most notable examples that highlight the challenges stated above. These implementations can require thousands of lines of code and hundreds of functions, which are difficult to navigate due to the low-level C used to write their codes. Additionally, transport protocol implementations in the Kernel are tightly linked with the neighbouring layers of the network stack, utilizing complex data structures for packet processing and socket interface. Thus, implementing protocols from the start or modifying already existing ones can be a considerably difficult task. Nevertheless, instead of directly implementing protocols to the Linux Kernel, we opted to use the eXpress Data Path (XDP) framework as our first step. This framework allows a simple and safe loading of new user-defined code to the Linux Kernel. Moreover, several characteristics of the framework are ideal for the implementation of transport layer protocols, such as its loading point being in the Network Interface Card (NIC) driver and allowing Kernel bypass. Thus, this thesis also introduces a back-end developed in the XDP framework, to which the MTP code can be compiled using our code generator. During the development of this back-end, we explored XDP in depth to make wise design decisions. This includes utilizing a set of data structures best suited for our model, making the most of the helper functions available in its libraries, and bypassing the limitations of this framework. Finally, we show that it is possible to specify the logic of transport protocols in a high-level language and translate it to XDP. We implemented two protocols, TCP and RoCEv2, in the MTP language and successfully translated them with our compiler to the XDP back-end. Moreover, between two servers connected by 100Gbps links, the TCP implementation presented 80Gbps of throughput with 16 cores processing packets. Meanwhile, RoCEv2 translation is functional but still needs further optimizations to reach its expected performance. Lastly, we evaluate the strengths and weaknesses of XDP for transport programming.Item DINO Features for Salient Object Detection(University of Waterloo, 2025-01-20) Ding, Albert; Veksler, OlgaIn the field of computer vision, it can be useful to solve the problem of modeling the visually “salient” areas in a scene viewed by a human. One way to formulate this problem is to give an estimate of how likely a pixel is to belong to an “object” (as opposed to the background) which altogether forms a “saliency” mask. This has become a task commonly known as Salient Object Detection (SOD). Supervised methods for this task are given a set of images and their corresponding pixel-precise saliency mask targets (often hand-labeled) and aim to learn the relationship between them. Unsupervised SOD methods in comparison attempt to identify salient objects by solely examining an image. This gives unsupervised methods the advantage of not needing expensive labels which are susceptible to human error. One good place to start an unsupervised method from is a technique called unsupervised feature learning. Interestingly, the Vision Transformer (ViT) [30] which struggled to find its place in the task of image classification, was able to produce features that are directly useful for SOD when it is trained in an unsupervised manner [11] called self-DIstillation with NO labels (DINO). The authors of LOST [97] which investigates DINO features further have found that the “keys” from the last attention layer stand out as the most useful. Melas-kyriazi et al. [80] and TokenCut [120] explore how applying spectral clustering methods to these features can be a good way to do tasks in computer vision without supervision. In this thesis we choose to continue to investigate these features for use in SOD by developing a K-means clustering-based method. From our experiments with a multitude of methods for using DINO features we observe that the clusters are rich in salient information. This could mean that the features themselves are particularly useful for SOD when processed by clustering methods. We first apply K-means clustering to DINO features, then select some clusters to be salient according to various heuristics, upscale and post-process the resulting coarse saliency maps, obtaining pseudo-ground truth. Finally, we train a SelfReformer [136] saliency model on our pseudo-ground truth. The most important step of our approach is the heuristic which decides on salient clusters after K-means clustering. We have done an extensive development and evaluation of many heuristics, and, surprisingly, the simplest heuristic which assigns the clusters not touching the image border to be salient works the best, outperforming the complex method based on eigenvectors presented in [80], after SelfReformer training.Item Code Generation and Testing in the Era of AI-Native Software Engineering(University of Waterloo, 2025-01-17) Mathews, Noble Saji; Nagappan, MeiyappanLarge Language Models (LLMs) like GPT-4 and Llama 3 are transforming software development by automating code generation and test case creation. This thesis investigates two pivotal aspects of LLM-assisted development: the integration of Test-Driven Development (TDD) principles into code generation workflows and the limitations of LLM-based test-generation tools in detecting bugs. LLMs have demonstrated significant capabilities in generating code snippets directly from problem statements. This increasingly automated process mirrors traditional human-led software development, where code is often written in response to a requirement. Historically, Test-Driven Development (TDD) has proven its merit, requiring developers to write tests before the functional code, ensuring alignment with the initial problem statements. Applying TDD principles to LLM-based code generation offers one distinct benefit: it enables developers to verify the correctness of generated code against predefined tests. This paper investigates if and how TDD can be incorporated into AI-assisted code-generation processes. We experimentally evaluate our hypothesis that providing LLMs like GPT-4 and Llama 3 with tests in addition to the problem statements enhances code generation outcomes. We experimented with established function-level code generation benchmarks such as MBPP and HumanEval. Our results consistently demonstrate that including test cases leads to higher success in solving programming challenges. We assert that TDD is a promising paradigm for helping ensure that the code generated by LLMs effectively captures the requirements. As we progress toward AI-native software engineering, a logical follow-up question arises: Why not allow LLMs to generate these tests as well? An increasing amount of research and commercial tools now focus on automated test case generation using LLMs. However, a concerning trend is that these tools often generate tests by inferring requirements from code, which is counterintuitive to the principles of TDD and raises questions about their behaviour when the flawed assumption of the code under test being correct is violated. Thus we set out to critically examine whether recent LLM-based test generation tools, such as Codium CoverAgent and CoverUp, can effectively find bugs or unintentionally validate faulty code. Considering bugs are only exposed by failing test cases, we explore the question: can these tools truly achieve the intended objectives of software testing when their test oracles are designed to pass? Using real human-written buggy code as input, we evaluate these tools, showing how LLM-generated tests can fail to detect bugs and, more alarmingly, how their design can worsen the situation by validating bugs in the generated test suite and rejecting bug-revealing tests. These findings raise important questions about the validity of the design behind LLM-based test generation tools and their impact on software quality and test suite reliability. Together, these studies provide critical insights into the promise and pitfalls of integrating LLMs into software development processes, offering guidelines for improving their reliability and impact on software quality.Item Constrained Diffusion: Applications to Image Generation, Manifold Learning, and Motion Planning(University of Waterloo, 2025-01-14) Szabados, Spencer; Yu, YaoliangThis thesis delves into the theoretical foundations, extensions, and applications of diffusion modelling in generative tasks. Diffusion models have garnered significant attention due to their stability during training and superior performance compared to competing methods. In an attempt to make this work approachable for those not already familiar with diffusion, we begin by developing diffusion models from the ground up, starting with continuous diffusion processes and later deriving popular discrete diffusion models via discretization, providing insights into their mechanics. Motivated by work in the physical sciences, where datasets reside on curved surfaces, we describe extensions to Riemannian manifolds by redefining Brownian motion in these domains and formulating stochastic differential equations that describe continuous diffusion processes on manifolds. In much the same vein, as many real-world datasets are constrained within specific boundaries, we explore reflected diffusion processes. These processes describe diffusion processes that are constrained to a bounded region without absorption at the boundary, ensuring that generated data remains within a desired support. At the end of each of these chapters, we address the numerous practical challenges in training neural diffusion models on these different processes, as well as developing a few techniques that improve training stability of such models. Further, we investigate structure-preserving diffusion models that respect inherent symmetries present in data, such as rotational invariance in imaging applications. We provide a complete characterization on the form of drift and diffusion terms required to ensure the diffusion processes, and diffusion model, accurately preserve affine group invariances present within target distributions. Three core techniques are discussed for achieving such group invaraince, with each being evaluated over a set of datasets focused on applications in Medical imaging. In closing out this section, we discuss in detail extensions of this work to reflected diffusion processes and Riemann manifolds. Finally, we highlight some proof-of-concept work on applying reflected diffusion models to the domain of robotic motion planning. Focusing on generating collision-free paths for robot navigation and multi-segment robotic arms, we demonstrate how diffusion models can address the complexities inherent in planning under motion constraints. This application showcases the practical utility of the extended diffusion modeling framework in solving real-world problems.Item Advanced Machine Learning Techniques for Taxonomic Classification and Clustering of DNA Sequences(University of Waterloo, 2025-01-09) Alipour, Fatemeh; Kari, Lila; Lu, Yang YoungAdvancements in genomic sequencing have exponentially increased the availability of DNA sequence data, presenting new opportunities and challenges in bioinformatics. This thesis addresses the critical need for scalable and precise computational tools to enhance taxonomic classification and clustering of DNA sequences through the application of advanced machine learning techniques. We introduce several novel algorithms designed to improve the accuracy and efficiency of these processes, focusing on both supervised and unsupervised machine learning approaches. Firstly, we introduce "DeLUCS'', a deep learning-based method for the unsupervised clustering of DNA sequences. DeLUCS utilizes invariant information clustering to optimize the grouping of sequences without prior taxonomic information. We validate this model across multiple genomic datasets, including vertebrate mitochondrial genomes, bacterial genome segments, and viral sequences. DeLUCS significantly outperforms traditional methods such as K-Means and Gaussian Mixture Models, establishing its effectiveness for analyzing large, unlabelled DNA datasets. Secondly, we explore the taxonomic classification of emerging astroviruses using a hybrid machine learning approach that effectively combines supervised and unsupervised techniques. Our novel methodology integrates k-mer composition analysis of whole genomes with host species data, which is crucial for accurately identifying and classifying novel and as-yet unclassified astroviruses. This approach addresses the challenges posed by genetic recombination and broad interspecies transmission that traditional host-based classifications fail to accommodate. By applying our method, we successfully proposed genus labels for 191 previously unclassified astrovirus genomes, and further identified potential cross-species infections, demonstrating the need for a revised understanding of astrovirus taxonomy. Additionally, we present "CGRclust'', a novel method employing twin contrastive learning with convolutional neural networks (CNNs) for clustering Chaos Game Representations of DNA sequences. CGRclust leverages a unique data augmentation strategy and advanced model architecture and improves upon traditional sequence classification by avoiding the need for DNA sequence alignment or taxonomic labels. This approach demonstrates robust performance, outperforming existing methods like DeLUCS and MeShClust v3.0 with superior clustering accuracy on diverse datasets, including mitochondrial genomes and viral sequences. Our comprehensive evaluations illustrate that these methods significantly advance the accuracy and computational efficiency of genomic data analysis. Specifically, our novel algorithms, including DeLUCS and CGRclust, leverage deep learning and contrastive learning models to refine the classification of DNA sequences, without the dependency on prior taxonomic knowledge or sequence alignment. These improvements demonstrate how machine learning can transform the field of genomic analysis, setting a new standard for taxonomic classification and providing a foundation for future explorations in evolutionary biology and biodiversity.Item Using Domain Adaptation to Improve Water Quality Modeling with Scarce Data(University of Waterloo, 2025-01-06) Cheung, Chi-Chung; Layton, AnitaWater Quality (WQ) modelling is important not just to the conservation of ecosystems, but also to the welfare of modern human society. However, collecting enough high-quality data to use for training WQ prediction models is difficult. Unlike hydrology, current WQ collecting methods are constrained by cost, spatial coverage, and temporal sparsity. This thesis explores using Domain Adaptation (DA) to overcome the data scarcity problem. By treating the different WQ measuring locations as different domains, high- resolution data from other locations can be used to better model a target location that has sparse data. The chosen DA method is inspired by domain-invariant (DI) representation learning. The model itself consists of (1) an f submodel representing the DI portion, and (2) one g submodel per domain representing the domain-variant portion. Within the context of this thesis, the main findings are as follows: 1. DA can be successfully applied in the context of WQ modeling 2. The optimal model sizes are different between the full DA method and just the pretraining. 3. Using a station’s basin was not a good measure of similarity. 4. At a high number of domains, further increasing the number of domains did not increase model performance. 5. Simply adding the outputs of f and g (i.e. f (x) + g(x)) did not perform as well as passing the output of f through g (i.e. g(f (x))). These findings support the effectiveness of using DA in WQ modelling as well as present various considerations that affect the final performance. Furthermore, these findings are relevant to not only this particular DA method but also to DA in general.Item Augmenting Digital Media Consumption via Critical Reflection to Increase Compassion and Promote Prosocial Attitudes and Behaviors(University of Waterloo, 2025-01-06) Lee, Ken Jen; Law, EdithMuch HCI research on prompting prosocial behaviors focuses on methods for increasing empathy. However, increased empathy may have unintended negative consequences. Our work offers an alternative solution that encourages critical reflection for nurturing compassion, which involves motivation and action to help others. In a between-subject experiment, participants (N=60) viewed a climate change documentary while receiving no prompts (CON), reflective prompts to focus on their emotions (RE) or surprises (RS). State compassion, critical reflection, and motivation to act or learn were measured at the end of the session (post-video) and two weeks later (follow-up). Despite participants' condition not affecting compassion, critical reflection was positively correlated with post-video state compassion. RE and RS participants demonstrated deeper reflection and reported higher motivation to learn post-video, and more prosocial behavioral changes during follow-up. RS participants reported better follow-up recall than RE participants. We conclude by discussing implications on designing technology to support compassion and longer-term critical reflection.