WebAssembly Replay Sandbox for Student Debugging
ISEF Category: Systems Software
Ready to Turn This Idea Into a Real Project?
This guide was put together with the help of AI research tools to give you a solid starting point.But a competitive science fair project lives in the details: refining your research question, fine-tuning your variables, analyzing your data, and presenting your findings like a seasoned scientist.
For next steps tailored to your interests, skill level, and timeline, work one-on-one with a MehtA+ mentor. Learn more about MehtA+ Science & Engineering Research Mentorship →
Subcategory: Languages and Operating Systems · Difficulty: Advanced · Setup: University Lab · Time: Full Year
The Hook
Debugging a program can feel like trying to fix a bike while it is moving. Now imagine if you could pause, rewind, and inspect every step without rebuilding the whole machine each time. That is the promise of deterministic replay. For student programmers, that could make hard bugs much easier to understand.
What Is It?
A deterministic replay system records enough information about a program run so you can play it back the same way later. Think of it like a video recording for execution. You do not just see the final crash. You can return to the exact moment when the bug first appeared.
WebAssembly, often called Wasm, is a compact code format that runs in a sandboxed environment in browsers and other runtimes. For this project, you would study whether a Wasm sandbox can support rewindable debugging for student code without saving a full virtual machine snapshot every time. That matters because full snapshots can be slow and large. A replay system tries to store less, then reconstruct the path back through execution when you need it.
Why This Is a Good Topic
This is a strong science fair topic because you can measure it with real data. You can compare speed overhead, memory use, and how accurately the system replays a run. You can also test different program types, like loops, random number use, or input-heavy code, to see where replay breaks down. The project connects to real debugging tools, education software, and runtime systems, and it teaches you about instrumentation, benchmarking, and careful evaluation.
Research Questions
- How does a WebAssembly replay sandbox affect runtime overhead compared with native execution?
- What is the effect of different program behaviors, such as heavy looping or user input, on replay accuracy?
- Does recording event traces instead of full state snapshots reduce memory use without hurting rewind quality?
- To what extent does deterministic replay stay faithful when student code uses random numbers or time-based calls?
- Which kinds of bugs are easiest to find when a program can be paused and rewound step by step?
- How does the replay system compare with rr in overhead and usability for small educational programs?
Basic Materials
- Laptop or desktop computer with a modern browser or Wasm runtime.
- Sample student programs with known behavior.
- Python for test automation and analysis.
- A text editor or code editor such as VS Code.
- Spreadsheet software for logging benchmark results.
- Timer or benchmarking tool built into your runtime.
- Storage space for trace files and logs.
- Graphing tool for plotting overhead and replay error.
Advanced Materials
- University workstation or lab machine with multiple CPU cores.
- WebAssembly runtime with debugging and instrumentation support.
- Linux environment for rr comparisons.
- Compiler toolchain for building Wasm targets.
- Profiling tools such as perf or flame graphs.
- Trace analysis scripts in Python or R.
- Version control system for experiment tracking.
- Large storage drive for repeated benchmark logs.
Software & Tools
- Python: Automates benchmark runs, parses logs, and computes overhead metrics.
- VS Code: Helps you edit, run, and compare multiple test programs.
- rr: Provides a replay debugging baseline for overhead and fidelity comparisons.
- Google Sheets: Organizes raw measurements and simple summary charts.
- ImageJ: Not needed here, so skip it unless you add visual interface testing.
Experiment Steps
- Define the replay model you want to test, including what state you will record and what you will reconstruct later.
- Choose a small set of benchmark programs that stress different behaviors, such as loops, input, and randomness.
- Design a baseline comparison against native execution and a second replay tool, such as rr.
- Plan measurements for speed, memory, trace size, and replay fidelity so you can compare results fairly.
- Build controls that isolate the effect of the replay system from compiler settings, input changes, and machine load.
- Analyze the results with graphs and error checks, then decide where the sandbox helps and where it breaks down.
Common Pitfalls
- Testing only one tiny program, which hides the cost of replay on different execution patterns.
- Comparing Wasm runs to native runs without matching compiler settings, which makes the overhead numbers unfair.
- Ignoring nondeterministic inputs like random numbers or timestamps, which causes replay to fail in ways that look random.
- Measuring memory with snapshot files and trace files in the same bucket, which makes storage results meaningless.
- Assuming a replayed run is correct just because it reaches the same final output, which can hide wrong intermediate steps.
What Makes This Competitive
A stronger version of this project would compare several replay designs, not just one. You could test how well each design handles nondeterminism, input events, and longer student programs. You could also use statistical tests to compare overhead across many runs instead of relying on one example. A top project would explain why one design wins for education, not just which one runs faster.
Project Variations
- Test the replay sandbox on browser-based coding exercises instead of local Wasm programs.
- Compare event-log replay with periodic snapshot replay for the same student programs.
- Measure how well the sandbox handles JavaScript-to-Wasm educational runtimes with mixed input and output.
Learn More
- MDN Web Docs WebAssembly: A clear overview of WebAssembly, found by searching MDN for WebAssembly basics.
- rr documentation: The official replay debugger docs, useful for understanding deterministic replay and how rr records execution.
- MIT OpenCourseWare operating systems materials: Search MIT OpenCourseWare for operating systems lectures on processes, memory, and debugging.
- PubMed: Search for education technology and debugging-related human factors papers if you want user-study ideas.
- ACM Digital Library: Search for peer-reviewed papers on deterministic replay, Wasm runtimes, and software debugging.
