Skip to content

test(corpus): retire the stale pdf.js exclude list - #1346

Merged
dekobon merged 3 commits into
mainfrom
fix/1282-pdfjs-exclude-list
Aug 23, 2026
Merged

test(corpus): retire the stale pdf.js exclude list#1346
dekobon merged 3 commits into
mainfrom
fix/1282-pdfjs-exclude-list

Conversation

@dekobon

@dekobon dekobon commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Fixes #1282.

What changed

  • tests/corpus/pdf_js_test.rs: the 118-entry mozjs-era exclude list (fix(tests,mozjs): tree-sitter-javascript parse failures skip pdf.js tests #84, closed) is retired entirely; expected_files rises 266 → 384.
  • Submodule bump to big-code-analysis-output@94b60c00 (already on its main): the 118 orphaned mozjs-era snapshots refreshed to the current output format, plus the 5 DeepSpeech orphan snapshots deleted (files still excluded under track(grammar): tree-sitter-cpp blockers behind mozcpp/deepspeech skips (#83) #86), so on-disk snapshot counts equal asserted counts for every corpus.
  • Harness hardening (tests/common/mod.rs): the corpus harness now fails when a .snap on disk matches no resolved corpus file, naming the orphans — closing the mechanism that let 123 stale snapshots accumulate silently. expected_snapshot_path is the single source of the file→snapshot mapping shared by act_on_file and the guard, and orphan_snapshots is pinned by a read-only unit test over the committed PHP snapshots (tests/corpus/snapshot_guard_test.rs).
  • Docs: both stale tests/README.md corpus-table rows corrected (pdf.js 384/384 with no excludes; DeepSpeech 1042/1042, exclude count 7 → 5) plus a paragraph on the orphan guard; CHANGELOG entry under Unreleased.

Why the fix diverges from the issue

The issue's probe (bca dump | rg ERROR) matched source textMAX_ERROR, ERRORS: 0, a regex literal containing NEXT ERROR — not parse-error nodes, which bca dump renders as a {ERROR:…} node kind. Re-probing all 118 files with rg '\{(ERROR|MISSING)' (validated against the 5 genuinely-broken DeepSpeech excludes) found zero remaining failures, so the list was deleted rather than shrunk to 3 and no successor tracking issue is needed.

Validation

  • Snapshot diff review across all 118: metric-value shifts plus output-format evolution (era-old n1/mi_* keys → current naming, new npa/cda fields), no structural changes except one start_line: 2 → 1 matching current behaviour; the 266 previously-asserted snapshots are byte-unchanged.
  • Guard perturbation-verified: an extension-filter break fails only the new unit test while every corpus test stays green.
  • make pre-commit: BCA_GATE: pass on each commit.

The 118-entry exclude list froze in the mozjs-default era (#84, closed);
under the post-#507 upstream tree-sitter-javascript grammar every entry
parses without ERROR nodes, so the list goes away entirely and the
asserted file count rises 266 -> 384. The issue's probe had reported
3 residual failures, but `rg ERROR` over `bca dump` output was matching
source text (MAX_ERROR, an ERRORS: property, a regex literal), not
parse-error nodes, which dump renders as a `{ERROR:...}` kind.

The submodule bump refreshes the 118 orphaned mozjs-era snapshots to
the current output format and deletes the 5 DeepSpeech orphan
snapshots (files still excluded under #86), so on-disk snapshot
counts equal asserted counts for every corpus. The tests/README.md
corpus table rows are corrected to match.

Fixes #1282
Found by the post-#1282 audit-tests pass: insta is loud about a
missing snapshot, but a stale extra .snap is asserted by nothing and
silently pins values no test verifies -- the exact mechanism that let
118 pdf.js and 5 DeepSpeech snapshots pin grammar-era-old output for
years. The harness now asserts every on-disk .snap under
snapshots/<repo>/ corresponds to a resolved corpus file and fails
naming the orphans.

Verified by planting snapshots/php/bogus.php.snap: the suite passed
before this change and fails naming the file after it.

Refs #1282
Review follow-up to the #1282 guard: it was verified only by a one-off
manual plant, so nothing committed failed if its filter silently broke,
and it re-derived the corpus-file-to-snapshot mapping that act_on_file
also computes, 100 lines away.

Extract expected_snapshot_path as the single source of that mapping
(act_on_file now derives insta's snapshot_path from it) and
orphan_snapshots as a testable function. The new test runs read-only
over the committed PHP snapshots, withholding one file from the
expected set to simulate an orphan. Perturbation-verified: changing the
guard's extension filter to match nothing fails only the new test while
every corpus test stays green, which is exactly the silent breakage the
corpus tests cannot see.

Refs #1282
@dekobon
dekobon merged commit b1c0264 into main Aug 23, 2026
35 checks passed
@dekobon
dekobon deleted the fix/1282-pdfjs-exclude-list branch August 23, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(corpus): pdf.js exclude list is 97% stale — 115 of 118 files now parse cleanly

1 participant