Repository navigation
fix(entities): read TOLERANCE's §20.4.49 version branch the right way up (#226) - #262
Merged
Merged
Conversation
… up (#226) §20.4.49 makes TOLERANCE's unknown short, height and dimgap R13-R14 only, which the R2007+ split-stream reader had already measured. The inline reader for R13 to R2004 had it upside down: the short only on R2007+, the height and dimgap everywhere, then the DIMSTYLE handle read inline past the data-stream boundary. Read as printed, the list closes on all 21 TOLERANCE records of the public corpus, R14 to R2018, and the insertion point and text equal AutoCAD's DXF export on R2000 to R2018. The unit test that pinned the R2010 short, height and dimgap is removed; the R2000 roundtrip now builds the R13-R14 shape it was writing. examples/probe_tolerance.rs reproduces it; ARCHITECTURE.md §7p records it.
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. |
10 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 TOLERANCE with §20.4.49's version branch the right way up. The unknown short, height and dimgap are R13-R14 only, and the DIMSTYLE handle is not a data-stream field. The 9 TOLERANCE records that errored on ACadSharp's R14, R2000 and R2004 saves now close. All 21 TOLERANCE records of the public corpus close, and on R2000 to R2018 their values equal the DXF twin. With #258 (TEXT/ATTRIB/ATTDEF) and #261 (MTEXT) this finishes #226.
Closes #226 (once #258 and #261 are merged; this PR is queued after them).
Spec reference
§20.4.49 TOLERANCE (46): R13-R14 only an unknown short,
BDheight andBDdimgap; then on every release3BDinsertion point,3BDx direction,3BDextrusion and theTVtext; the DIMSTYLE handle is in the handle data.The inline reader that serves R13 to R2004 had the branch upside down. It read the short only on R2007+ and the height and dimgap on every release, then read the handle inline, past the data-stream boundary. The R2007+ split-stream reader had already measured that those three fields are absent from R2007 on.
Records it was measured on
examples/probe_tolerance.rs(new) reports closure. It also compares insertion point, x direction, extrusion and text with theAcDbFcfgroup of the DXF twin by handle. Caret escapes are undone; omitted groups are counted, not assumed.On R14 the three leading fields are
10 10 10on all three records, the zero code ofBSandBD. Their widths close the record, but their values corroborate nothing, and R14 has no twin.Coverage,
../../samplesUnchanged, TOTAL 3911 / 525 / 9. The 19-file corpus holds TOLERANCE only on R2018.
Public corpus:
tools/corpus/baseline.tsv(regenerated, committed)The 52-file total goes from 13781 / 1985 / 308 to 13790 / 1985 / 299 on its own. It will be regenerated on top of #258 and #261 in the serial rebase.
Class census and reference closure
Unchanged on all 19 files of
../../samplesand in the 52-row baseline's census and closure columns.Docs
docs/data/spec-coverage.tsv§20.4.49 →closeswith the measurement;docs/spec-coverage.mdregenerated.src/entities/tolerance.rs: cites §20.4.49 (was "§19.4.44"). The struct docs say which fields are R13-R14 only, and thatdimstyle_handleis not read.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 baselinetolerance::tests::roundtrip_tolerance_r2010_includes_unknown_shortis removed. It asserted an R2010 unknown short, height and dimgap that the split-stream reader and the corpus show are absent.roundtrip_tolerance_r2000now builds the R13-R14 shape it was already writing: it writes the short, decodes as R14 and no longer writes an inline handle. Its two assertions on that handle are gone, because the handle is not a data-stream field. Its value assertions are unchanged.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.49 of the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1), on the corpus bytes, and on AutoCAD's DXF exports of the same drawings, read as data files (ACadSharp
samples/atc30a97ce, MIT, pinned by #225). 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.