Repository navigation
feat(entities): decode SUN from AutoCAD's own DWG and DXF output (#152) - #332
Merged
Merged
Conversation
…49, #152) ODA spec v5.4.1 prints no MATERIAL layout. The field list is derived by the CLEANROOM.md method of 2026-10-26: the data bits of all 212 corpus records (R14 to R2018) against the AcDbMaterial AutoCAD exported to DXF for the same handle. Every record closes on its data-stream boundary on every release, from R2007 on a string stream the list consumes entirely, and 13,058 values equal the DXF twin by handle with 0 differences. Fields no DXF group shows are named unknown_* and listed in ARCHITECTURE.md section 7s. probe_material becomes the twin probe over the shared harness (examples/support/twin.rs, identical to the objects lane's copy). The strings-only read_strings and its tests are kept untouched. Baseline: decoded +212, skipped -212, errored 0.
…XF output (#152) WIPEOUTVARIABLES, ACDB_DYNAMICBLOCKPURGEPREVENTER_VERSION, ACDB_BLOCKREPRESENTATION_DATA, PDFDEFINITION and DBCOLOR have no spec layout. Each is derived by the CLEANROOM.md method of 2026-10-26 from the data bits of the 42 corpus records (R14 to R2018) against the DXF object of the same handle. All close on every release, from R2007 on a fully consumed string stream, and 50 values equal the DXF twin with 0 differences. DBCOLOR from R2004 reads the colour word (group 420 and xdata 1071), name and book; its leading BS is unverified. One probe per class over the shared twin harness. Baseline: decoded +42, skipped -42, errored 0.
…AD's own DWG and DXF output (#152) BLOCKGRIPLOCATIONCOMPONENT, BLOCKLINEARGRIP, BLOCKVISIBILITYGRIP, BLOCKLINEARPARAMETER, BLOCKVISIBILITYPARAMETER and BLOCKSCALEACTION have no spec layout. Derived by the CLEANROOM.md method of 2026-10-26 from the data bits of the 84 corpus records (R14 to R2018) against the DXF objects of the same handles: a shared AcDbEvalExpr / AcDbBlockElement / AcDbBlockGrip base chain and a tail per class. All close on every release, from R2007 on a fully consumed string stream, and 1,158 values equal the DXF twin with 0 differences. Handles are not decoded. Baseline: decoded +84, skipped -84, errored 0.
…152) ODA spec v5.4.1 prints no DIMASSOC layout. Derived by the CLEANROOM.md method of 2026-10-26 from the data bits of the 21 corpus records (R14 to R2018) against the AcDbDimAssoc of the same handle: a flags word, two head values and one osnap point reference per set flag bit. All close on every release, from R2007 on a fully consumed string stream, and 264 values equal the DXF twin with 0 differences. The dimension and reference handles are not decoded. Baseline: decoded +21, skipped -21, errored 0.
…CAD's own DWG and DXF output (#152) ODA spec v5.4.1 prints no layout for the solid-history records. Derived by the CLEANROOM.md method of 2026-10-26 from the data bits of the 21 corpus records (R14 to R2018) against the DXF objects of the same handles; the box shares the evaluation base of the dynamic-block objects. All close on every release, from R2007 on a fully consumed string stream, and 152 values equal the DXF twin on R2007 to R2018 with 0 differences (the R2000 and R2004 exports hold neither object). Handles are not decoded; ACSH_EXTRUSION_CLASS is not decoded. Baseline: decoded +21, skipped -21, errored 0.
…as no twin for it AutoCAD's R2000 and R2004 DXF exports omit ACSH_HISTORY_CLASS and ACSH_BOX_CLASS entirely, and the twin harness failed every such record as unpaired. When a release's export holds no record of the kind at all, the record is now checked by its boundary only and says so, as on R14; a missing record where the export holds others of the kind still fails.
…st AutoCAD's own DXF (#152) The dispatcher routed the UNDERLAY family on R2010 and later only, so the PDFUNDERLAY records of R14, R2000, R2004 and R2007 were skipped. The arm moves beside IMAGE and WIPEOUT, which run on every release. With the routing repaired the R14, R2000 and R2004 records ended 8, 8 and 16 bits past their data-stream boundary: the decoder read the definition handle inline before R2007, but the handle is in the handle stream on every release, so the read and the Underlay.definition_handle field are gone. All seven corpus records (one per release, R14 to R2018) now close exactly on the boundary, and 36 values (groups 10, 20, 30, 280, 281, 282) equal the DXF twin by handle on R2000 to R2018 with 0 differences (examples/probe_underlay.rs). Scale, rotation, normal and the clip-vertex encoding are unverified by value: the DXF omits them at their defaults. Baseline: decoded +1, skipped -1 on each of R14, R2000, R2004 and R2007. Tests touched: the four in-module tests of entities::underlay lose the inline handle write and its assertions and the version argument; none added.
ODA spec v5.4.1 prints no layout for the sun of a drawing's lighting settings. The earlier entities::sun decoder sat on the fixed type code 0x4F9, which no corpus record carries, and its layout rested on no AutoCAD output; it is replaced by one derived by the CLEANROOM.md method of 2026-10-26 from the data bits of the corpus's one SUN record (geoloc.dwg, R2018) against the AcDbSun object of the same handle in its DXF export. SUN is a non-entity object, so it now reaches the dispatcher as a custom class. The record closes on a fully consumed string stream and 11 values (groups 90, 290, 421, 40, 291, 91, 92, 292, 70, 71, 280) equal the DXF with 0 differences. The corpus holds no SUN on any other release; group 63 is not a field of the data bits. Baseline: decoded +1, skipped -1 (geoloc.dwg). Tests touched: the two in-module tests of the replaced entities::sun::decode are removed with it (a writer round trip of the earlier layout and a pre-R2007 refusal); none added. dispatch.rs loses OBJECT_TYPE_SUN from the list its fixed_entity_label_covers_every_body_arm check walks.
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. |
This was referenced Oct 26, 2026
Merged
Unprinted classes: decoded from one drawing each; provisional until controlled AutoCAD drawings
#348
Open
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd9a7f3937
ℹ️ 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".
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
Merged
3 tasks done
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
arch.py renumber printed every section main had renumbered under a stacked PR's base, even when none of the PR's lines cited one; refresh.sh then ran `git commit -qam` with nothing to commit and refused a mergeable PR. It now prints only the moves that rewrote a line, nothing when none did, and refresh.sh commits the renumber only when the tree changed. Checked at a47e1bf against main: the old script printed "§7bh->§7bi §7bi->§7bj" with no change, the new one prints nothing; at #331's head it prints only 7bj->7bk, at #332's 7bj->7bk 7bk->7bl §7bi->§7bj.
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
…branch holds The landed PR's head and the stacked branch can have several merge bases, a commit of the landed PR and a main commit, and `git merge-base` returns one. When the branch merged main after taking the landed PR's commits, merging against that PR's commit drops the main history the branch already holds, and a change main later reverted comes back. refresh.sh now considers every merge base, and takes one only when each of the branch's ordinary merge bases with main is its ancestor; otherwise the branch merges as it always has. Reproduced in a scratch repository: with the landed PR's commit as base the merge kept the reverted f=1, the new rule rejects that base and git merge gives f=0; a plain stack still takes the PR's commit and merges cleanly where git merge conflicts. On the real branches #331, #332 and #341 still take a47e1bf (#330), and #383 takes none.
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
… landed PR below it (#422) * fix(ci): merge a stacked PR against the newest commit it holds of the landed PR below it Every time a PR of a stack landed, the train refused every PR above it: their merge base was an old main commit, so the train's own commits on the landed PR (its merges of main, the renumbered section, the measured baselines) conflicted with the stacked copies of the same lines. After #329 landed, #330 to #341 all refused on examples/probe_dim_assoc.rs, and a lane hand-merged each with `git merge-tree --merge-base=<newest commit of the landed PR it holds>`. refresh.sh now finds that base itself (the head of each PR main squashed since the merge base, its merge base with the branch, the nearest one main does not hold), merges against it with git merge-recursive and the usual conflict handling, and writes it to merge-base.sha for the oracle comparison. A PR that is not stacked merges exactly as before. arch.py renumber also rewrites references in the PR's lines to a section main renumbered when the PR below landed, matched by title. * fix(ci): report a section move only when it rewrote a line arch.py renumber printed every section main had renumbered under a stacked PR's base, even when none of the PR's lines cited one; refresh.sh then ran `git commit -qam` with nothing to commit and refused a mergeable PR. It now prints only the moves that rewrote a line, nothing when none did, and refresh.sh commits the renumber only when the tree changed. Checked at a47e1bf against main: the old script printed "§7bh->§7bi §7bi->§7bj" with no change, the new one prints nothing; at #331's head it prints only 7bj->7bk, at #332's 7bj->7bk 7bk->7bl §7bi->§7bj. * fix(ci): use a stacked base only when it holds every main commit the branch holds The landed PR's head and the stacked branch can have several merge bases, a commit of the landed PR and a main commit, and `git merge-base` returns one. When the branch merged main after taking the landed PR's commits, merging against that PR's commit drops the main history the branch already holds, and a change main later reverted comes back. refresh.sh now considers every merge base, and takes one only when each of the branch's ordinary merge bases with main is its ancestor; otherwise the branch merges as it always has. Reproduced in a scratch repository: with the landed PR's commit as base the merge kept the reverted f=1, the new rule rejects that base and git merge gives f=0; a plain stack still takes the PR's commit and merges cleanly where git merge conflicts. On the real branches #331, #332 and #341 still take a47e1bf (#330), and #383 takes none.
DrunkOnJava
enabled auto-merge (squash)
October 28, 2026 05:41
DrunkOnJava
added a commit
that referenced
this pull request
Oct 28, 2026
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
Stacked on #331 (which is stacked on #330, #329, #328, #326 and #325): this branch contains their commits and lands after them; its own change is the single commit on top.
Decodes SUN (
AcDbSun). ODA spec v5.4.1 prints no layout for it; the field list is derived by the CLEANROOM.md method of 2026-10-26 from the data bits of the corpus's one SUN record against theSUNobject of the same handle in AutoCAD's own DXF export. SUN is a non-entity object (it carries the common object data and its owner dictionary's handle), so it now reaches the dispatcher through the custom-class object path.The earlier
entities::sundecoder sat on the fixed type code 0x4F9, which no corpus record carries, and its layout rested on no AutoCAD output. It is replaced rather than kept beside the new one: the fixed-code arm, its label and its type-code constant are removed fromdispatch.rs.ObjectType::Sunstays as it was.Spec reference
None: §20.4 has no entry for SUN, so there is no
docs/data/spec-coverage.tsvrow; theCAMERA / LIGHT / SUN / HELIXrow ofdocs/spec-coverage.md("Classes the spec does not prescribe") is split and SUN is set tocloses. Layout and evidence: ARCHITECTURE.md §7y (provisional letter). Per-class record: CLEANROOM.md (2026-10-26).Evidence (
cargo run --release --example probe_sun -- ../dwg-corpus):The record is
geoloc.dwg's (handle 0x23B, paired with the DXFSUNof the same handle): groups 90, 290, 421 (the low 24 bits of the colour word), 40, 291, 91, 92, 292, 70, 71 and 280. It closes on the data-stream boundary with the string stream consumed. This is one record on one release: no other drawing of the corpus holds a SUN, so no other release is shown (a release before R2007 is refused as unsupported). Unverified by value: group 63 (7 in the twin; not a field of the data bits, whose leading colourBSreads 0), the order of the two booleans that read 0 (status, group 290, and daylight savings, group 292), and the colour flag bits above 0. The owner handle (330) is not decoded. Corpus baseline, relative to #331's head: decoded +1, skipped -1 ongeoloc.dwg, errored 0 (measure.py checkpasses on this head).Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features,cargo test --release --all-featurespass locally on this headprobe_sunover the 52 pinned drawings (1 record closes, 11 values against the DXF twin, 0 differ)python3 tools/ci/spec_coverage.py --checkpassesentities::sun::decode(roundtrip_sun_noon_summer,rejects_pre_r2007) are removed with it; they wrote and read back the earlier layout through theBitWriter, and the function they called no longer exists. Indispatch.rs,OBJECT_TYPE_SUNleaves the list thatfixed_entity_label_covers_every_body_armwalks.objects::sh_history::read_colorbecomespub(crate)for reuse.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:
My contribution is based on AutoCAD's own output, by the method recorded in CLEANROOM.md (2026-10-26): an AutoCAD-written DWG compared with AutoCAD's own DXF export of the same drawing, from the pinned public corpus (ACadSharp
samples/geoloc.dwgandgeoloc.dxf; data files only). No third-party DWG or DXF implementation was consulted, ACadSharp's and ezdxf's reading code, comments, tests and derived data included. No vocabulary beyond the DXF group codes and subclass marker in the twin was used.Developer Certificate of Origin
I affirm that the contribution is my own work and can be distributed under the project's Apache-2.0 license.