Repository navigation
fix(entities): read §20.4.41's version-2 SAB envelope to its terminator (#228) - #283
Merged
Merged
Conversation
…or (#228) §20.4.41 gives a version-2 ACIS envelope as a SAB file written with no length, opening with "ACIS BinaryFile" and ending with End\x0E\x02of\x0E\x04ACIS\x0D\x04data. The decoder refused version 2, so the two 3DSOLIDs and one REGION of each of ACadSharp's R2004, R2007 and R2010 saves errored. Read to the terminator, all nine close, and the §20.4.41 tail after each is identical across the three releases. A version-2 text SAT envelope, which the spec says needs a parser, is refused. The unit test that pinned the version-2 refusal is removed. ARCHITECTURE.md §7u records it; §20.4.41 moves to closes.
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. |
7 tasks done
# Conflicts: # ARCHITECTURE.md # docs/data/spec-coverage.tsv # docs/spec-coverage.md # tools/corpus/baseline.tsv
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
Read version-2 ACIS envelopes. §20.4.41 says a binary (SAB) file follows with no length, and that it ends with a fixed terminator. The decoder refused version 2 outright, so the two 3DSOLIDs and one REGION of each of ACadSharp's R2004, R2007 and R2010 saves errored. All 9 now close. Part of #228; DIMSTYLE and HATCH follow, and VIEW is the oracle lane's.
Spec reference
§20.4.41 REGION (37), 3DSOLID (38), BODY (39), version 2: "Immediately following will be an acis file. Header value of 'ACIS BinaryFile' indicates SAB, otherwise it is a text SAT file. No length is given. SAB files will end with
End\x0E\x02of\x0E\x04ACIS\x0D\x04data. SAT files must be parsed to find the end."The envelope reader now reads a version-2 SAB file byte by byte up to that terminator. A version-2 text SAT file is refused with
Unsupportedrather than scanned for an end the spec says needs a parser, and any version other than 1 or 2 is aSectionMaperror.Records it was measured on
0xD65,0xD6A0xD69Every SAB file opens with
ACIS BinaryFileand ends on the terminator, and the record closes exactly at the data-stream boundary after the §20.4.41 tail. That tail is identical across the three releases, handle by handle: wireframe point0xD65(17.78, −220.85, 2.5),0xD69(24.99, −220.40, 0),0xD6A(31.69, −220.11, 2.19); 4 isolines; no wires; no silhouettes. The SAB files themselves differ only in their ACIS file-version bytes and length (7,620 bytes for0xD65on R2004, 7,660 on R2007/R2010), since AutoCAD writes the ACIS version each target release reads. R2013 and later keep the SAB stream in the data-storage section (§7h) and were already closing.Coverage,
../../samplesUnchanged, TOTAL 4256 / 180 / 9 (the 19-file corpus holds ACIS only on R2018, in the data store).
Public corpus:
tools/corpus/baseline.tsv(regenerated, committed)measure.py checkpasses. Regenerated in the serial rebase.Class census and reference closure
Unchanged on all 19 files of
../../samplesand in the baseline's census and closure columns.Docs
docs/data/spec-coverage.tsv§20.4.41partial→closes;docs/spec-coverage.mdregenerated.three_d_solid.rsmodule and function docs record version 2.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningsRUSTFLAGS="-D warnings" cargo test --release --all-features(real-file tests ran against../../samples)RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurestools/corpus/measure.py checkpasses against the committed baselinethree_d_solid::tests::version_two_is_refusedasserted that a version-2 envelope is refused. The corpus disproves that: nine version-2 SAB records close.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).My contribution is based on §20.4.41 of the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1), which gives both the SAB header and its terminator, and on the corpus bytes. No third-party code or comments were read.
Developer Certificate of Origin
By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1.