Repository navigation
fix(tables): read the entry header's 64-flag and Xdep bits by release, under the spec's names - #235
Merged
Merged
Conversation
…, under the spec's names §20.4.54 and every table section give the entry header as TV name, B 64-flag, BS xrefindex+1, B Xdep. TableEntryHeader called the first bit is_xref_dependent and the last is_xref_resolved, and the R2007+ split-stream decoders, which read the two bits ahead of the BS, stored them in the opposite fields, so the same on-disk bit landed in a different field depending on the release: is_xref_dependent held the 64-flag on R2000 to R2010, and on R2013 and R2018 is_xref_resolved did. The DXF value oracle settles which bit is which. AutoCAD's exports leave bit 16 of group 70 (Xdep) clear on every table entry of the corpus and never write bit 64. On R2007 and R2010 the first bit of the pair is the one that is clear on every entry, on R2013 and R2018 the second, so read_entry_flags now orders them by release. The fields are flag_64 and is_xref_dependent on every release; Xdep equals the export's bit 16 on all 899 table entries and 264 BLOCK records of the nextgis and ACadSharp exports, where 308 disagreed before. STYLE's xref flag (0x08), derived from Xdep, was set on R2000 to R2010 styles and now follows the right bit. Refs #99
DrunkOnJava
enabled auto-merge (squash)
October 26, 2026 09:25
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. |
DrunkOnJava
disabled auto-merge
October 26, 2026 09:27
3 tasks done
DrunkOnJava
enabled auto-merge (squash)
October 26, 2026 10:30
This was referenced Oct 26, 2026
2 of 3 tasks
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
The table-entry header's two flag bits land in the field the spec names them by, on every release:
TableEntryHeadernow hasflag_64andis_xref_dependent(Xdep), and the R2007+ reader orders the two bits by release as AutoCAD's own DXF exports show they are ordered.Spec reference
§20.4.54 LAYER and every other table section (§20.4.52, .56, .58, .60, .62, .64, .66, .68) give the header as
TV name, B 64-flag (70), BS xrefindex+1, B Xdep (70, bit 16). Onmain:TableEntryHeadercalled the first bitis_xref_dependentand the lastis_xref_resolved, so on R2000 and R2004is_xref_dependentheld the 64-flag;BS(measured earlier on R2018 STYLE) and stored them the other way round, so the same bit landed in a different field by release.Which bit is which on R2007+ is settled by the DXF value oracle (#99): AutoCAD's exports leave bit 16 of group 70 clear on every table entry of the corpus and never write bit 64. On R2007 and R2010 the first bit of the pair is the one clear on every entry; on R2013 and R2018 it is the second.
read_entry_flagsnow orders them by release (documented on the function). The corpus has no xref-dependent entry, so it pins which position carries the always-clear bit, not a set Xdep; that caveat is in the docs.StyleEntry's xref flag (0x08) is derived from Xdep; it was set on R2000 to R2010 styles and now follows the right bit.Test plan
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-featurescargo test --release --all-features(with the 19-file../../samplescorpus present): all pass; the renames touch three existing assertions, no test addedexamples/dxf_oracle, the pairing and scorer example that follows feat(dxf): an ASCII DXF reader keyed by handle, for the value oracle #223), over the 42nextgis/dwg_samplesdrawings atff05d5a8and the ACadSharpsamples/atc30a97ce(the pinned set of ci(corpus): measure the reader on public drawings fetched by pinned hash #225), every table record paired with AutoCAD's export of the same drawing by handle:Before (
main): the header bit scored against bit 16 of group 70 (cells:=all agree,≠k/nk of n disagree):After (this branch):
308 disagreements become 0; the oracle's total disagreements across the corpus fall from 420 to 112 (the remainder are the VPORT and LAYOUT findings, which have their own PRs, and the open ones listed on #99). Decode counts are unchanged: the same bits are consumed.
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 the ODA specification v5.4.1 (§20.4.54 and the other table sections), Autodesk's public DXF Reference (group 70 bits 16 and 64), and AutoCAD's own DXF exports in
nextgis/dwg_samplesand the ACadSharpsamples/directory, read as data only. No permissively-licensed project's 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.
Refs #99