Repository navigation
fix(fixtures): write the R2000 file-header CRC and end sentinel - #215
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Oct 26, 2026
The gate compared a PR run against a criterion baseline cached from the last push to main. Hosted runners differ in CPU, so whenever the two ran on different hardware every bench moved by a constant factor the confirmation re-run cannot clear. PR #215 touched no benchmarked code and still failed with lz77_decompress and stage1_build_section 1.35-1.78x slower on both passes; four dependabot PRs that only bumped action versions failed the same way on October 21. A PR run now checks out its merge-base with main in a second worktree, benches it as baseline `main` into the same target directory, then benches the merge commit as `pr`, so the ratio and absolute floor judge code rather than hardware. Stale criterion output restored by rust-cache is removed first. The baseline cache steps are gone; a push to main just runs the benches. run-benches.sh skips a target the tree being benched does not declare, so it also runs on an older merge-base.
build_flat_fixture wrote the §3.2 locator table into a zeroed buffer and never emitted the CRC or the 16-byte end sentinel, so the canonical synthetic_2000.dwg carried 0000 where the spec calculation gives 0x7813. The generator now writes both, using the crate's own r13_locator_seed and the sentinel constant the streaming header reader validates against; the streaming reader drops its private copy of the seed table. Regenerating changes only bytes 52-68 of synthetic_2000.dwg; offsets, the five entities and the other four fixtures are unchanged. The streaming acceptance run now reads that fixture through the strict header entry point at every chunk size from 1 to 32 bytes. Closes #214
DrunkOnJava
force-pushed
the
fix/canonical-r2000-header
branch
from
October 26, 2026 01:17
b914c29 to
6205f6b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The canonical R2000 fixture generator now writes the §3.2 file-header CRC and end sentinel, so
synthetic_2000.dwgpasses the strict streaming header reader. Closes #214.Spec reference
ODA Open Design Specification for .dwg files v5.4.1, §3.2.6: "RS: CRC for BOF to this point", seed 0, XORed with 0xA598 for three locators, followed by the 16-byte sentinel
95 A0 4E 28 99 82 1A E5 5E 41 E0 5F 9D 3A 4D 00.build_flat_fixturewrote the locator table into a zeroed buffer and never emitted either field, so the fixture stored0000where the calculation gives0x7813.crc::crc8over bytes 0..52, XORcrc::r13_locator_seed(3)) andstreaming::END_SENTINEL.streaming::END_SENTINELis public; the streaming reader usescrc::r13_locator_seedinstead of a private copy of the seed table.synthetic_2000.dwg. Offsets, the five entities and the R2004-family fixtures are byte-identical.tools/streaming/verify.pyreads the canonical fixture through the strict header entry point at every chunk size from 1 to 32.Test plan
cargo fmt --all -- --check-D warnings(full matrix in CI)verify.pyon the builtstream_headerandstreaming_schedules): passed, including the new canonical case, headerAC1015, locators[0,256,64] [1,0,0] [2,594,18]coverage_report tests/fixtures/canonical: 25 / 0 / 0, every handle-map entry resolvedcheck_invariants.pyOnly the file header is valid in the spec sense here. The header-variable block is still placeholder zeros, locator 1 points at no class section, object-map and record CRCs are still wrong, and no AutoCAD build has opened the file; those follow in separate PRs.
The first run's
Criterion benches vs main baselinefailure was runner variance against a baseline cached on other hardware; #217 fixed the gate, and this branch is rebased onto it for a same-host measurement.Source-provenance declaration
Clean-room declaration. All code in this PR was written from scratch. The only sources consulted were this repository and the ODA's public Open Design Specification for .dwg files v5.4.1. No Autodesk SDK, ODA SDK (Drawings / Teigha), LibreDWG or other copyleft DWG implementation source, and no decompilation, was consulted. Spec citations are in the diff.