Skip to content

Seed the $bits* fixtures as their page does and convert them - #4569

Open
evanchooly wants to merge 1 commit into
audits-unordered-arraysfrom
audits-bits-seed
Open

evanchooly wants to merge 1 commit into
audits-unordered-arraysfrom
audits-bits-seed

Conversation

@evanchooly

Copy link
Copy Markdown
Member

Follows up the #4547 finding, as you asked ("fix the seed data"). Stacked on #4568.

Problem

The 12 $bits* query fixtures ($bitsAllClear, $bitsAllSet, $bitsAnyClear and $bitsAnySet, each with binDataBitmask, bitPositionArray and integerBitmask) share one seed file. Its third document was:

{ _id: 3, a: 20.0, binaryValueofA: "00010100" }

The legacy reader stores that 20.0 as a Double. The page inserts the same text through mongosh, which stores a whole-number literal as an Int32. So no documented reference reproduced these fixtures, and they stayed on the legacy path: legacy-references.json listed them as RESIDUAL_DIFFERENCE, a type difference at /2/a, with no lock explaining why.

Change

  • Seed data: the third document's a is now 20 in all 12 data.json files, matching what the page's insert stores. The pages print the result as 20 or 20.0, and both encode as the whole-number constraint (an Int32 or a Double), so the expected results needed no change.
  • References: the 12 now reproduce their pinned pages exactly. I spliced their references into legacy-references.json, and each pins the same source and origin its unresolved entry already named. I didn't rerun references over the whole file, because that would re-derive every pin against today's tree, where most fixtures have already converted. The summary moves 12 from RESIDUAL_DIFFERENCE to references (239 → 251), and unresolved goes from 81 to 69.
  • Conversion: all 12 convert. Each fixture directory now holds only scenario.json. The manifest and ledger are regenerated.
  • Reviewed file edits: NameBackport.verify holds every retired fixture file to its bytes in the preserved corpus, so the edited seed failed preservation. The ledger already records reviewed test-body edits (bodyEdit), and this adds the same for fixture files:
    • fileEdits, by file name, holds the digest the edit started from and the reason;
    • FixtureMigration.preserved(ledger) gives the preservation check those starting digests;
    • FixtureMigration.verify rejects an edit of a file the move didn't remove, an edit that changes nothing, and an edit with no reason;
    • the field is omitted when empty, so the other 351 entries are unchanged.

Decisions for review

  • The seed follows the page's insert, not the fixture's text. Mongosh is the shell the page documents, and it stores 20.0 as an Int32. A Double 20.0 would test the same bitwise behavior, but no page documents it.
  • The edit is recorded, not hidden. The preserved corpus still holds the original bytes, and the ledger says what changed and why.

Verification

  • TestBitsAllClear, TestBitsAllSet, TestBitsAnyClear and TestBitsAnySet (12 cases, none skipping a check) pass under Critter, then reflection.
  • Core operator tests: 678 pass under both mappers.
  • Audits suite: 453 pass under both mappers, including a new test for the three invalid file-edit cases.

Self-reviewed only: the independent reviewers are out of quota until 2026-11-26.

The 12 $bits* query fixtures share seed data whose third document had
a: 20.0, a Double. The page inserts it through mongosh, which stores the
whole-number literal as an Int32, so no documented reference reproduced
them. The seed now has a: 20; the references pin the pages the gaps
already named, and all 12 convert and pass under both mappers.

The ledger records each changed data.json as a reviewed file edit with
the digest it started from, so the preservation check still holds every
retired file to the corpus snapshot.

This branch has not been deployed

No deployments
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.

1 participant