Terminal project · 6 units · Free
Build a time-travel debugger, part two
Take your debugger to a real compiled game, then use it to find planted bugs in six later builds.
Get the course on GitHubTake part one first, or at least read its lessons 01 to 06, because part two uses its ideas without teaching them again.
- What you’ll learn
- A WebAssembly interpreter, record and replay, stepping backwards through a recording, questions about past writes, function names and a call stack.
- Your project
- Your debugger running on Lob, a small artillery game compiled to WebAssembly, and finding the first bad write in six builds with planted bugs.
- How you’ll work
- 6 units, numbered 08 to 13 after part one’s seven · 44 checks. Read each lesson, commit an answer to each prediction question, then write the unit’s code and check it with Node.
What you’ll build
- An interpreter for the 62 WebAssembly instructions the course’s games use, checked against Node’s own WebAssembly engine, with part one’s debugger running on it unchanged.
- Recording and exact replay, snapshots that copy only the memory pages written since the last one so stepping backwards stays cheap, and an index of which write last set any byte.
- Function names, a call stack and line numbers read from the binary, then a ladder of six later builds of Lob and a second game, Lob II, each with one planted bug for your debugger to find within a replay budget.
Lob is the game the Sightline course works out from the outside. Here you debug it from the inside.
Before you start
The ideas part two takes from part one are ticks, events and traces, checkpoints and replay, breakpoints, watchpoints and reverse search. Part one is a separate course and isn’t in this course folder, but part two includes part one’s finished debugger so you can work through it on its own, though reading that file spoils part one.
You write JavaScript modules, and the lessons use typed arrays, DataView, BigInt and structuredClone. The course asks for Node 22 or newer. It was tested with Node 26.5.1 on macOS, from a fresh clone with an empty environment. There’s no install, account, network connection or paid service.
Three AI learners finished all six units of the earlier edition, before this build-through chapter was added. The new chapter routes have package and execution checks, but no new full six-unit learner trial. No person has taken the course yet, and the 40 to 60 hour estimate is the author’s guess. A pass shows your code met the checks’ cases. It doesn’t show that you learned what the lessons teach.
Clone and start
Clone the learner source, check out this edition and enter the course folder.
git clone https://github.com/itsHabib/free-to-learn.git
cd free-to-learn
git checkout 55ee347dcb66cdab12281d636d6041eaac48f335
cd courses/time-travel-debugger-part-twoOpen lessons/08.html in your browser for the offline build-through chapter, or read lessons/08.md, before creating a project.
Choose one starting route below. Both use a new folder named project, which the rest of the chapter's commands use. Run the commands from the course folder.
Write the important parts: fill six code regions while following the located listings.
node examples/start-chapter.mjs project write
node lab.mjs check project 08 --help-used "chapter write starter; six regions unfinished"This initial check fails until you fill the six regions.
Start with working code: follow the supplied Machine's execution and code tour.
node examples/start-chapter.mjs project supplied
node lab.mjs check project 08 --help-used "supplied Machine checkpoint; initial baseline"This initial check passes because the Machine is supplied. Both routes then lead to a bounded-execution application you build yourself. The two start commands refuse an existing project, so do not run both. API.md is the contract for every function you write, and node lab.mjs lists every lab command.
Commit a prediction with node lab.mjs predict project ID ANSWER, and the lab shows the right answer and why. node lab.mjs status project lists your checks and predictions.
The checks run your own JavaScript with your normal permissions. They aren’t a sandbox, so run code you understand.
Exact learner source
The commands above use learner edition 55ee347dcb66cdab12281d636d6041eaac48f335. This static page doesn’t run or grade code.