The direction
Today stoop skips when every input is byte-equal to last time. The goal is to skip when the effective input is equal, loosening the rule only where it can be shown not to hide a change. Each step below either lets stoop skip more safely or makes it run more when it should.
Planned
- Equal build artifacts (early cutoff)
- When a rebuild produces the same bytes, steps downstream of it should skip. This already works when builds are reproducible, because a downstream step that reads the output sees the same bytes. Next is hashing executables by what loads, ignoring build ids, timestamps and debug sections.
- Normalized source
- Hash source with comments and whitespace removed, per language and conservatively, keeping directives that change behavior such as
//go:build, pragmas, and docstrings that are runtime values. - Coverage granularity
- Tie a test to the code it actually executed, so an edit to a function no test calls doesn't rerun the suite.
- A determinism check
- Run a step twice when recording and refuse to record one that disagrees with itself. Aimed at flaky tests and hidden clock or random reads.
- Static vetoes
- Scan what a step read for clock, randomness and network calls, and refuse to skip. A static signal can only make stoop run more, never less.
- Restored outputs
- Let a skip also put back what the command produced, so a build skipped on a fresh runner leaves its artifacts in place.
Recently shipped
- Probes for external state (
--probe). - Hashing every byte of every input, with no sampling.
- Naming the destination when a run is refused for using the network.
- Sharing proofs through the git remote (
--sync git,stoop pull,stoop prune). - Tracing Node, by refusing
io_uring.
Ideas and objections are welcome in the issue tracker.
