Repository navigation
fix(entities): read MTEXT's §20.4.46 version branches on R13 to R2004 (#226) - #261
Merged
Merged
Conversation
…#226) The inline MTEXT reader read the R2000+ line spacing on every release and stopped before the R2004+ background flags, so all 36 MTEXT records of ACadSharp's R14 save and all 36 of its R2004 save errored. One field reader now serves every release, with the line spacing R2000+ and the background flags and block R2004+ as §20.4.46 prints them; all 257 MTEXT records of the public corpus close, and every value, the two R2004+ backgrounds included, equals AutoCAD's DXF export of the same drawing on R2000 to R2018. MText keeps the background flags and block it used to skip. examples/probe_mtext.rs reproduces it; ARCHITECTURE.md §7o records it; tools/corpus/baseline.tsv records the two files' new counts.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1b47e2a08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This was referenced Oct 26, 2026
# Conflicts: # ARCHITECTURE.md # docs/data/spec-coverage.tsv # docs/spec-coverage.md # tools/corpus/baseline.tsv
Group 1 went through the numeric same(), so "001" matched "1" and an identical "NaN" differed. Text is now compared exactly after the caret escapes are undone; the numeric tolerance stays for numeric groups.
# Conflicts: # ARCHITECTURE.md # tools/corpus/baseline.tsv
DrunkOnJava
enabled auto-merge (squash)
October 26, 2026 15:28
This was referenced Oct 26, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
…d say what measured them (#140, #147, #148, #133, #127) (#398) Seven rows leave partial for closes because no record of any kind errors on the 52 drawings of run 40532346172 and the errors their notes still quote were fixed: TEXT, ATTRIB, ATTDEF (#258), MTEXT (#261), VIEW (#263, #284), DIMSTYLE (#293) and HATCH (#264, the R14 records routed). §22 AcDb:Template goes from missing to partial: dxf_header reads $MEASUREMENT from it (#320). §9 stays closes, now tracked by #127 (R13) and carrying the per-release evidence behind closing #128, #129 and #130. The page's Last measured line and the paragraph that said closes came from a local 19-file corpus are updated.
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
…ain run (#195) (#401) * docs(spec-coverage): move the rows the 2026-10-27 main run proves, and say what measured them (#140, #147, #148, #133, #127) Seven rows leave partial for closes because no record of any kind errors on the 52 drawings of run 40532346172 and the errors their notes still quote were fixed: TEXT, ATTRIB, ATTDEF (#258), MTEXT (#261), VIEW (#263, #284), DIMSTYLE (#293) and HATCH (#264, the R14 records routed). §22 AcDb:Template goes from missing to partial: dxf_header reads $MEASUREMENT from it (#320). §9 stays closes, now tracked by #127 (R13) and carrying the per-release evidence behind closing #128, #129 and #130. The page's Last measured line and the paragraph that said closes came from a local 19-file corpus are updated. * docs(criteria): re-measure the 1.0 requirements from the 2026-10-27 main run (#195) Header, R2, R3, R4, R8, X1 and S3 now carry what run 40542129639 (main 61255e9) and docs/data/spec-coverage.tsv say: 52 drawings with 0 errored records and 533 skipped, 53 sections scored by the DXF oracle with 22 values disagreeing, 90 closes, 13 partial, 6 decoder and 29 missing rows, a wasm32 compile of the library in the Clippy job. X1 (DXF) moves from not measured to failed: the HEADER, TABLES, ENTITIES and BLOCKS probes pair the written records with AutoCAD's export and find 0 groups disagreeing, and 342 entity records of 18 kinds and the OBJECTS section are not written. No other status changes. * docs(criteria): R3 counts the rows #398 moves: 97 closes, 7 partial, 6 decoder, 28 missing (#195) The counts are those of docs/data/spec-coverage.tsv with #398, whose moves run 40532346172 proves.
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 MTEXT with §20.4.46's version branches on R13 to R2004. Line spacing is R2000+, and R2004+ adds the background flags and block. All 72 MTEXT records that errored on ACadSharp's R14 and R2004 saves now close. Every one of the 257 MTEXT records of the public corpus closes, and the values agree with the DXF twins, the R2004+ backgrounds included. Part of #226: TEXT/ATTRIB/ATTDEF is #258, and TOLERANCE follows.
Spec reference
§20.4.46 MTEXT (44): after the
TV, R2000+BSline spacing style,BDline spacing factor and an unknownB; R2004+BLbackground flags, then, when bit0x01is set (or0x10on R2018),BDscale,CMCcolour andBLtransparency.delta+21 / +69 / +77)delta−2 / −122)BLbackground flags, and for two records the background blockOne field reader now serves every release. The
TVis inline before R2007 and from the string stream after.MTextgainsbackground_flagsandbackground: Option<MTextBackground>(scale, CMC colour, transparency) so the block can be checked, not just skipped. A colour byte announcing a colour or book name is refused (Unsupported), since no corpus record has one. R13/R14 store no line spacing, so those two fields read 0 there rather than a default the record does not hold.Records it was measured on
examples/probe_mtext.rs(new) reports closure and compares each MTEXT with the DXF twin by handle. It covers insertion point, extrusion, x-axis direction, reference width and height, text height, attachment, drawing direction, line spacing, the R2004+ background (90, 45, 421, 441) and the text. The R2007+ DXF is read as UTF-8, and its^Jcaret escapes are undone.export_sample.dwg(R2018)The two backgrounds agree on R2004 and later: flags
1, scale1.25, true colour0x367542(421 =3568962), transparency0. One MTEXT per save (0x1032) has no entity with its handle in the DXF; it is counted, not compared.Coverage,
../../samplescargo run --release --example coverage_report -- ../../samples: unchanged, TOTAL 3911 / 525 / 9. The 19-file corpus holds MTEXT only on R2018, which already closed.Public corpus:
tools/corpus/baseline.tsv(regenerated, committed)52-file total: 13781 / 1985 / 308 → 13853 / 1985 / 236.
measure.py checkpasses against the committed baseline.Class census and reference closure
probe_class_censusandprobe_reference_closureon all 19 files of../../samplesgive output identical to the run before the change. The census and closure columns of the 52-row baseline are unchanged.Docs
docs/data/spec-coverage.tsv: the §20.4.46 note states the measurement (statecloses).docs/spec-coverage.mdis regenerated.src/entities/mtext.rs: module doc cites §20.4.46 (was "§19.4.23") and records the measurement.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 baselineSource-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.46 (field list, branches and DXF codes) and §20.4.75 (group 421 pairs with a CMC's
BLRGB word) of the ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1). It also uses the corpus bytes and AutoCAD's DXF exports of the same drawings, read as data files (ACadSharpsamples/atc30a97ce, MIT, pinned by #225). The caret escape the probe undoes is the one the twins show:^Jwhere the record holds a line feed. 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.