Skip to content

fix(tables): VIEW's view mode as DXF group 71 (§20.4.60) - #284

Merged
DrunkOnJava merged 2 commits into
mainfrom
fix/view-mode-71
Oct 26, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
fix/view-mode-71

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

VIEW's view mode is now surfaced as DXF group 71, the way #238 did for VPORT (#256, item 1).

§20.4.60 stores the view mode as four bits: "0: 71's bit 0 (1), 1: 71's bit 1 (2), 2: 71's bit 2 (4), 3: OPPOSITE of 71's bit 4 (16)", and notes that bit 3 (8) of group 71 "can not be specified". Both VIEW decode paths (pre-R2007 and the R2007+ split stream) returned the raw bits. They now return the group-71 value through tables::vport::viewmode_from_bits (made pub(crate)), with no UCSFOLLOW bit. The value oracle's VIEW scorer drops its own conversion and compares view_mode with group 71 directly.

One commit on main, after #279.

Test plan

  • DXF value oracle over the 102 pinned files: view_mode equals group 71 on all 6 VIEW records (one per release, R2000-R2018). The only change to tools/oracle/baseline.tsv is the row rename from view_mode (stored bits, as group 71) to view_mode. --baseline against the regenerated TSV exits 0, and the TSV reproduces byte for byte.
  • cargo test --release --lib tables::: 34 pass. The two existing VIEW round-trip tests write the bits 0001, so their expected value changes from the stored 1 to the group-71 value 0. No test added.
  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, python3 tools/ci/spec_coverage.py --check
  • Decode counts are unchanged: the same bits are read and only their surfaced value differs, so tools/corpus/baseline.tsv stays as it is.

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:

  • No Autodesk DWG SDK source (RealDWG, ObjectARX, ObjectDBX) or NDA-protected Autodesk documentation was consulted or imported.
  • No Open Design Alliance Teigha / Drawings SDK source was consulted or imported. The ODA's public Open Design Specification for .dwg files PDF is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

Based on ODA spec v5.4.1 §20.4.60 and §20.4.64.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the Developer Certificate of Origin 1.1.

Closes #256. With #293 (the R2007+ reactor count) fixing VIEW's Xdep bit on R2013/R2018, every decoded VIEW value now equals the export, which is all #256 asks.

@DrunkOnJava
DrunkOnJava force-pushed the fix/view-mode-71 branch 8 times, most recently from 6c0664c to ded5b9d Compare October 26, 2026 18:07
@DrunkOnJava
DrunkOnJava marked this pull request as ready for review October 26, 2026 18:07
§20.4.60 stores VIEW's view mode as four bits, "0: 71's bit 0 (1), 1:
71's bit 1 (2), 2: 71's bit 2 (4), 3: OPPOSITE of 71's bit 4 (16)", and
notes that bit 3 (8) of group 71 "can not be specified". Both VIEW paths
surfaced the raw bits; they now surface the group-71 value through the
conversion VPORT uses (§20.4.64, #238), with no UCSFOLLOW bit.

The DXF value oracle compares ViewEntry::view_mode with group 71
directly now, instead of converting the stored bits in its scorer: equal
on all 6 VIEW records, R2000 to R2018. Its baseline row is renamed from
"view_mode (stored bits, as group 71)" to "view_mode". The two VIEW
round-trip tests write the bits 0001, whose group-71 value is 0.

Closes #256 (with #263, #279 and #293, every decoded VIEW value now equals the export).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T18:56:15.719013Z 030ee37 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
#344)

refresh.sh ratcheted a PR's DXF oracle run against main's baseline TSV, so
a field the PR deliberately renamed (#284: VIEW view_mode, six rows) showed
as six rows absent from the run and the train refused it. The comparison
baseline is now main's rows less those the PR's own committed TSV dropped
since the merge base (oracle_base.py).
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 26, 2026 19:01
@DrunkOnJava
DrunkOnJava merged commit f432436 into main Oct 26, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/view-mode-71 branch October 26, 2026 19:05
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VIEW reads its view mode as a BS before R2007 where §20.4.60 gives four bits

1 participant