Repository navigation
fix(entities): read TEXT, ATTRIB and ATTDEF as §20.4.3-§20.4.5 print them on every release (#226, #62) - #258
Conversation
…them on every release (#226, #62) The R2000-R2004 TEXT reader read a field when its data-flag bit was set, where §20.4.3 says a set bit means the field is absent; R13/R14 had no branch of their own; oblique, rotation and width factor were BD on every release where the spec prints RD; and ATTDEF read its prompt before the tag instead of after the ATTRIB fields. All 118 text records that errored on the public corpus (114 on ACadSharp's R14 to R2004 saves, 4 on export_sample.dwg) now close, and every value read equals AutoCAD's DXF export of the same drawing on R2000 to R2018. The four R2018 records state their own values in their text (obliquing 10, rotation 30, width 2.0), and the RD reading recovers them exactly. That is the file #62 asked for. examples/probe_text.rs reproduces it; ARCHITECTURE.md §7n records it; tools/corpus/baseline.tsv records the four 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. |
# Conflicts: # ARCHITECTURE.md # docs/data/spec-coverage.tsv # docs/spec-coverage.md # tools/corpus/baseline.tsv
|
Merge-train note for da7baaf: main had changed these docs/data/spec-coverage.tsv notes since this PR's base, and this PR rewrote them too. The PR's free text was kept and main's was dropped. Tool-written sentences (DXF oracle, spec examples) were kept and regenerated. Check that nothing below still needs saying:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da7baaf493
ℹ️ 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".
AC1021 and later DXF is UTF-8, as src/dxf_reader.rs reads it; taking each byte as a character turned a non-ASCII value such as U+2205 into mojibake before the comparison. Earlier releases stay byte per character.
* fix(ci): land.sh hands a PR back when a review thread opens after auto-merge The ruleset holds a PR with an unresolved thread, and land.sh's wait loop only watched for merge, DIRTY, a moved main and failing checks, so a thread the reviewer opened after auto-merge went on (#258, 2026-10-26) stalled the train until the deadline. The loop now turns auto-merge off and exits 2 on a positive unresolved count; a failed query counts as none. * fix(ci): land.sh treats any positive thread count as open, not just 1-99 * fix(ci): land.sh turns auto-merge off on every failed exit after enabling it A timeout or a failing check left auto-merge on, so the abandoned PR could merge while the train refreshed the next one (#298 review). A branch that strict up-to-date reports BEHIND now exits 8 for a real refresh instead of waiting out the deadline.
…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.
…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.
Summary
Read TEXT, ATTRIB and ATTDEF as §20.4.3, §20.4.4 and §20.4.5 print them on every release. The R2000-R2004 reader had the data flags inverted. R13/R14 had no branch of their own. Oblique, rotation and width factor were
BDon every release where the spec hasRD(#62). The ATTDEF prompt was read before the tag. Fixing all four makes all 118 erroring text records close (114 R14-R2004 records, 4 R2018), and every value read agrees with the DXF twin.Closes #62. Part of #226: MTEXT and TOLERANCE follow in their own PRs.
Spec reference
BDelevation and angles,2RDpoints,3BDextrusionBD(R2000-R2004 also read the height asBD)RDtext::decode(R13-R2004, inlineTV) andtext::read_modern_fields(R2007+,TVfrom the string stream) now share one §20.4.3 reader. Only theTVsource differs between them.#62: the file that writes the three fields
export_sample.dwg(R2018, pinned by #225) has four TEXT records that write the optional fields, and their text states the values. TheRDreading recovers those values exactly; aBDreading ends 62 bits short or 2 bits long, or hits the reserved11code:RDvalue0x44A0xFB0x44B0xF70x4540xEF0x4650xADRecords it was measured on
examples/probe_text.rs(new) reports closure for every TEXT, ATTRIB and ATTDEF and compares each value with the DXF twin by handle. Groups the DXF omits are counted, not compared against defaults. Angles are compared in degrees modulo 360. The groups of a multi-line attribute's embedded MTEXT (after101) are kept apart from the attribute's own.Not measured: every TEXT the twins cover leaves rotation, oblique and width factor at their defaults, so the
RDreading rests onexport_sample.dwg, which has no twin. The R14 save's 38 records close but have no twin.Coverage,
../../samplescargo run --release --example coverage_report -- ../../samples: unchanged, TOTAL 3911 / 525 / 9. Every text record of the 19-file corpus already closed on the R2007+ path, which elides the threeRDfields, and the R14-R2004 files hold no text.Public corpus:
tools/corpus/baseline.tsv(regenerated, committed)measure.py runthenmeasure.py check(exit 0 aftermeasure.py baseline):52-file total: 13781 / 1985 / 308 → 13899 / 1985 / 190. No other column moves.
Class census and reference closure
probe_class_censusandprobe_reference_closureon all 19 files of../../samplesgive output identical to the run before the change, and the census/closure columns of the 52-row baseline are unchanged.Docs
docs/data/spec-coverage.tsv: §20.4.3, §20.4.4 and §20.4.5 staycloses, now true of every record, and the TEXT oblique_angle / rotation_angle / width_factor read as BD where §20.4.3 types them RD — latent divergence no sample exercises #62 note is replaced with the measurement.docs/spec-coverage.mdis regenerated.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 baseline0xFFfor "no optional fields" instead of0x00, and write the height and the three optional fields asRD. The full-fields test also writes its alignment point as2DD, and the ATTDEF roundtrip writes the prompt after the flags. The five aretext::tests::{roundtrip_minimal_text, roundtrip_full_text_fields},attrib::tests::roundtrip_invisible_constant_attrib,attdef::tests::roundtrip_attdef_r2000andintegration_entity_regression::build_text_payload. Their 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.3, §20.4.4 and §20.4.5 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). The probe's group-to-field pairing uses the DXF codes §20.4.3 to §20.4.5 print, and group 74 for an attribute's vertical alignment; the twins corroborate it, since the decoded value equals group 74 wherever the DXF writes it. 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.