Skip to content
PirefactorCLI & tooling9 files · +329 −100

Audit and clean up TODOs in vendored nes-rust emulator (Rust)

Session from pi-nes-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

48msession
1interventions
GOAL

Inventory all @TODO comments in the codebase, assess whether they still made sense from an 8-year-old vendored dependency, and set up a fork to own fixes to that vendored code.

  1. Prompt · +0
    Inventory the @TODOs in the codebase and review each to see if needed, write findings to a .md
  2. Agent did · +0m
    Searched the repo for TODO markers, read through cpu.rs, ppu.rs, apu.rs, register.rs, mapper.rs, rom.rs in the vendored nes_rust crate, and wrote TODO_INVENTORY.md summarizing each TODO with an assessment.
  3. Prompt · +7m
    What are the urls for the vendored gh repos? Are they actively maintained?
  4. Agent did · +7m
    Found the vendored nes_rust crate points to github.com/takahirox/nes-rust, checked its GitHub API metadata, and reported it looked inactive (last push 2020-08-28).
  5. Prompt · +9m
    Since the vendor looks abandoned, fork it on GitHub under tmustier and set it up as the maintained copy
  6. Agent did · +9m
    Created VENDOR.md documenting the fork plan, updated README with a Vendored Dependencies section, and added scripts/update-vendor-nes-rust.sh to sync from the fork.
  7. Prompt · +22m
    These TODOs were added by the upstream author 8 years ago, not us — critically review whether they even still make sense
  8. Agent did · +24m
    Reviewed each TODO for validity against actual NES hardware behavior, flagged several as stale or wrong (e.g. 'throw error on invalid register' is incorrect since hardware ignores invalid writes), and marked each as Delete or Change in TODO_INVENTORY.md.
  9. Agent did · +28m
    Mirrored the delete/change decisions into the vendored TODO_INVENTORY.md, edited apu.rs, ppu.rs, cpu.rs, lib.rs to remove or rewrite stale TODOs (invalid-register no-ops, greyscale comment, master/slave note, unreachable button mapping, illegal opcode handling), then committed and pushed the changes.
  10. Intervention · +46m
    Developer noticed two duplicate TODO_INVENTORY.md files (root and vendor) and asked to just keep the vendor one, then had the agent delete the root copy.
    Why: We ended up with a duplicate inventory file in two places — I wanted a single source of truth in the vendor directory, not two copies to keep in sync.
  11. Outcome · +48m
    Root TODO_INVENTORY.md deleted, vendored inventory kept as sole source; 2 commits pushed to main (chore(nes-rust): clean stale todos, chore: drop root todo inventory).
VERDICT

Next time I'd start by asking the agent to check TODOs critically against actual hardware behavior rather than just listing them, since a chunk of the upstream TODOs turned out to be wrong or stale. The correction that mattered most was catching the duplicate TODO_INVENTORY.md files at the end — the agent happily maintained two copies until I pointed out we only needed one, in the vendor directory.

I tried this · 0

Discussion · 0

How Builds work