You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deep-debugging-tools: a migration differential, and corpus tests that print the provenance of what they ran (bisecting a corpus is a missing tool) #2230
Found on #2214. Re-migrating pcre2 under the zeroed migrator changed 15 sites in six files; the first pcre2-promote failed its heap-8 test (free 40960 printed as free unremembered block). Locating it took: the compiler alone on the checked-in corpus (pass), then the fresh files one at a time (all pass), then the official promote again (pass). The first failure never reproduced: it coincided with the native runner's first attempt at pcre2-build/pcre2-check-generated exiting 97 at Workspace.begin_intercept and the evaluator re-running them, so the test very likely ran a pcre2test built from a half-finished state. Two tools are missing, per Eric (2026-10-06: "when we are bisecting that means we have a lack of instrumentation"):
Corpus tests print what they ran.run_pcre2_test_action (and the zlib/tommyds/c-algorithms test actions) record nothing about the binary and bundle under test. Each should write a provenance line into its output dir and the log: the sha256 of the test binary, the .wo manifest key, the compiler's generation and the source digest of the corpus directory; <stem>-promote names it. A stale or partial build is then visible at the first failure instead of after three rebuilds. And build_runner_postprocess's 97 fallback must not leave the native attempt's partial outputs for the next target to consume: outputs land only on success (scratch + rename), and the fallback line names the outputs it discarded.
A migration differential.with migrate-diff <old-dir> <new-dir> (or with analyze over two migrations): pairs the changed functions, names the migrator rule behind each changed site (the migrator tags each rewrite it applies), compiles both corpora and diffs the MIR facts (analyze facts) of every changed function, and reports any difference beyond the intended rewrite — a drop, a move, an extra temporary, a changed call — by function and site. On migrate: map {0} initializers and memset-to-zero to T.zeroed() (D101) #2214 that answers "which of 15 .zeroed() rewrites changed behavior" in one run; the answer for this incident would have been "none", which points at the build.
Route to add to docs/spec/toolchain/deep-debugging-tools.md: A re-migrated corpus fails its own test suite → provenance line first, then migrate-diff, then the corpus route; never a file-by-file bisect.
Part 1 (corpus tests print what they ran) is PR #2232 on stack #2228. Part 2 v1 is tools/migrate_diff.w (branch migrate-diff, stacked on #2232, PR after the stack merges): lays both migrations out as the cohesive lib layout, check --dump-mir of the main module, per-function statement comparison with every positional id normalized. On #2214's pcre2 it names 4 functions, each with exactly the zeroed rewrite. Still open from this issue: the migrator naming the rule behind each rewritten site, and the 97-fallback leaving the native attempt's partial outputs in place (the likely cause of the never-reproduced heap-8 failure). A regex literal opening a statement is #2233.
Second half (migrator rule tags, rules.tsv read by migrate_diff) merged in db013d9 (PR #2247). Both halves of this issue are now in: the provenance lines and the 97-fallback discard (#2234), and the rule-attributed migration differential.
Activity
ehartford commentedon Oct 7, 2026
Part 1 (corpus tests print what they ran) is PR #2232 on stack #2228. Part 2 v1 is
tools/migrate_diff.w(branch migrate-diff, stacked on #2232, PR after the stack merges): lays both migrations out as the cohesive lib layout,check --dump-mirof the main module, per-function statement comparison with every positional id normalized. On #2214's pcre2 it names 4 functions, each with exactly the zeroed rewrite. Still open from this issue: the migrator naming the rule behind each rewritten site, and the 97-fallback leaving the native attempt's partial outputs in place (the likely cause of the never-reproduced heap-8 failure). A regex literal opening a statement is #2233.corpus tests print the provenance of what they run (#2230) (#2232)
migrate_diff: the migration differential; the 97 fallback discards pa…
migrate: every rewrite is tagged for migrate_diff; a static definitio…
c_import facade over an omitted function (#2244); unsafe calls in gen…
ehartford commentedon Oct 7, 2026
Second half (migrator rule tags, rules.tsv read by migrate_diff) merged in db013d9 (PR #2247). Both halves of this issue are now in: the provenance lines and the 97-fallback discard (#2234), and the rule-attributed migration differential.