Repository navigation
feat(streaming): stream the object records of an R2007 file (§20.1, #205) - #363
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. |
) R2007ObjectWalker is the R2007 whole-file walker with AcDb:AcDbObjects singled out, as R2004ObjectWalker is for the R2004 family: the section's bytes are framed in section order into records (MS size, payload, CRC, then type and handle), with no handle map or index held, and every other section passes through as the file walker reports it. No record is committed from a page whose codewords, CRC-64s and checksum have not all passed. An R2007 record is R2000's (RecordFormat::R2000: no MC, a BS type, an RL size, the handle), so the framer is shared and unchanged. ARCHITECTURE.md 7al measures it on the eight pinned R2007 drawings: 2,237 records tile their sections exactly, every CRC and every (handle, offset) of AcDb:Handles agrees, 34 records straddle a page boundary, and the same bytes read as R2010 records fail the first record's CRC. R2007ObjectCheckpoint (DWGQ) wraps the file walker's DWGR checkpoint, the section index, the framer's cursors and the unframed bytes; it is self-contained and restores in the wasm32 kernel and back, byte-identical. The framer's checkpoint fields moved into helpers shared with DWGO. verify_r2007_objects.py and verify_wasm_r2007_objects.py check it against an independent Python framing, the legacy reader and the AcDb:Handles map on every pinned drawing and on built files, with fresh-process resumes in every stage, forged checkpoints rejected and corrupt sections each ending in a named error.
DrunkOnJava
force-pushed
the
feat/stream-r2007-objects
branch
from
October 27, 2026 03:50
40e9a8a to
415fb98
Compare
# Conflicts: # ARCHITECTURE.md
DrunkOnJava
enabled auto-merge (squash)
October 27, 2026 04:41
This was referenced Oct 27, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
… to what landed (#205, #206, #207) (#400) The ledger stopped at the header and the R13-R2000 walk, and the README's checkpoint contract described the header checkpoint alone and said full object and decompression checkpoints remain open. Both now cover the ten checkpoint kinds on main and the walkers of #240, #246, #260, #276, #299, #312, #333, #340 and #363, the perf series #360 to #366, and cite the evidence files of Streaming E2E run 40532346151. What was not measured is marked NOT MEASURED.
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
Frames the object section of an R2007 (AC1021) file into records from the stream, in stream order, with no handle map or index held, as #333 does for the R2004 family.
R2007ObjectWalkeris the R2007 whole-file walker (#340) withAcDb:AcDbObjectssingled out; every other section passes through as before. No record is committed from a page whose Reed-Solomon codewords, CRC-64s and checksum have not all passed.An R2007 record is R2000's (
RecordFormat::R2000:MSsize,MSbytes of payload that open with aBStype, anRLsize and the handle, then a CRC; noMC), so the framer is shared and unchanged. The R2007 split streams are not entered: the type and handle are in the front of the data stream, and the string stream (TVtext) and handle stream (Hreferences) at the back of the payload are bytes to the framer.R2007ObjectCheckpoint(DWGQ) wraps the file walker'sDWGRcheckpoint, the section index, the framer's cursors and the not-yet-framed bytes (at most about 140 KB, bounded in theno_stdbuild). Self-contained: restore needs the source identity and nothing else, and it restores in the wasm32 kernel and back, byte-identical. The framer's checkpoint fields moved into helpers shared with the R2004DWGO, which is unchanged on the wire (its verifiers pass).Behavior kept as decided earlier: a stretch of the object section that no page covers arrives as a
Holeand is refused (ObjectsOrder); pages cannot arrive out of order because the file walk takes them in section-map order with rising offsets. A hole therefore ends the walk in a named error rather than being framed as zeros.Evidence, from the pinned corpus (
ARCHITECTURE.mdsection 7al):AcDb:Handlesagrees, 34 records straddle a page boundary (the largest takes 150,151 bytes), and the same bytes read as R2010 records fail the first record's CRC in all 8;sample_AC1021at 1.06 MB; none larger is pinned or available locally, so a drawing over 1.1 MB is still unmeasured, as are an AutoCAD-written stored header, a non-zero CRC seed and an encrypted section (refused by design).Spec reference
§20.1 (object record framing) on R2007; §19.1 and §7a for where the type, handle and the three streams sit. New dated section
ARCHITECTURE.md7al with its evidence table (arch.py checkpasses). No coverage-state change indocs/data/spec-coverage.tsv: no section's evidence moves, this adds a streaming reader for a layout the legacy reader already decodes. Part of #205.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warnings(one#[allow(clippy::large_enum_variant)]on the per-callR2007ObjectStep, which wraps the once-per-file 272-byte header step)RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurescargo +1.85 check --all-features(MSRV)cargo test --release --all-features(existing suites only; no test added; built without LTO to fit the machine's CPU budget)python3 tools/streaming/check_invariants.py(nostd::,alloc::,Vec, ... insrc/streaming/);tools/streaming/no_std.rscompiled natively and forwasm32-unknown-unknown, with new compile-time bounds forR2007ObjectWalkerandR2007ObjectCheckpointpython3 tools/maintainer/train/arch.py checkandpython3 tools/ci/spec_coverage.py --checkverify_r2007_objects.py(new; wired intostreaming.ymlwith the new example): 8 pinned drawings and 8 built files, 2,496 records; every line equal to the independent Python framing (r2007_ref.pyplusverify_objects.py's framer), the (handle, offset) pairs equal to an independent parse ofAcDb:Handles, the 8 drawings' records equal to the legacy reader's; 5 fixed chunk schedules, a source that fails every other read, 128 proptest schedules on two files; 1,402 fresh-process resumes in every framer and walker stage (131 holding unframed bytes, 51 inside anMS, 50 inside a CRC, 247 inside a payload); 450 bit flips, 450 truncations, a wrong identity and 284 resealed unreachable states rejected; 34 corruptions each ending in its named error with exactly the valid records before it committed (including a flipped codeword of the object section's second, last and a middle page: 151, 161 and 807 records, thenR2007Parity)verify_wasm_r2007_objects.py(new): 701 nativeDWGQcheckpoints restored in the wasm32 kernel (run under node) finish equal to the native resume, at kernel read sizes 1, 7, 64 and 256; the kernel's own checkpoint is byte-identical to the native one in all 701 and the native build finishes it; 83 flipped or wrong-identity checkpoints refused by the kernelverify_objects.py(32 files, 8,027 records) andverify_wasm_objects.pystill pass on this tree (the shared framer helpers)cargo build --locked --example stream_r2007_objects --example streaming_schedules, thenpython3 tools/streaming/verify_r2007_objects.py target/debug/examples/stream_r2007_objects target/debug/examples/streaming_schedulesandpython3 tools/streaming/verify_wasm_r2007_objects.py target/debug/examples/stream_r2007_objects.Source-provenance declaration
By submitting this PR I certify that my contribution does not incorporate executable code from any source whose license is incompatible with Apache-2.0. Specifically:
CLEANROOM.md).dwg-rsis Apache-2.0 and must remain compatible.My contribution is based on:
CLEANROOM.md.See
CLEANROOM.mdfor the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.
I will sign off commits with
git commit -swhen asked, which adds aSigned-off-bytrailer to the commit message asserting the DCO.