Skip to content

feat(objects): decode TABLESTYLE on R14 to R2007 from §20.4.101.1 (#151) - #303

Merged
DrunkOnJava merged 5 commits into
mainfrom
obj/tablestyle
Oct 26, 2026
Merged

DrunkOnJava merged 5 commits into
mainfrom
obj/tablestyle

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Decode TABLESTYLE on R14 to R2007 from §20.4.101.1. The notes that declined it said §20.4 has no entry for it; §20.4.101 prints it, in two layouts, and this is the "until R21" one. R2010 and later (§20.4.101.2) stay Unhandled here and are the next PR, stacked on this one.

Spec reference

§20.4.101.1 TABLESTYLE (tracking #151). Two readings come from the bits, not the spec's table (ARCHITECTURE.md §7x, with the budgets):

  • Data type, Data unit type and Format string are R2007+ together: R2004's record is 220 bits of header and 3 x 543 of rows, R2007's 138 and 3 x 579 (BL 512, BL 0, and a TV that costs no data-stream bits).
  • Every colour is the 44-bit TC (BS, BL, RC) on R2000 and R14 too, which is the only reading that fills R2000's 1849-bit budget (the same as R2004's).

Test plan

  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --release --all-features, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features, cargo +1.85 check --all-features, cargo run --release --example spec_examples: all pass locally.

  • Shown on real files, no new unit tests: cargo run --release --example probe_tablestyle -- <corpus> over the 52 pinned drawings. It closes on its boundary and compares every decoded value with AutoCAD's DXF export by handle.

    Release Records Close Values compared with the DXF Differ
    R14 8 8 no twin (boundary only)
    R2000 8 8 608 0
    R2004 8 8 608 0
    R2007 8 8 680 0
    R2010 and later 20 not decoded here
  • Corpus baseline regenerated (tools/corpus/baseline.tsv): decoded 14947 to 14979, skipped 831 to 799, errored unchanged at 296; the 32 rows that move are one record each.

  • Tests touched: none. examples/probe_tablestyle.rs and its shared harness examples/support/twin.rs are new probes, not tests.

  • The DXF oracle does not score TABLESTYLE yet (the oracle lane's scorers.rs is untouched).

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 (v5.4.1, sha256 973628f3…f504b) is explicitly allowed (see CLEANROOM.md).
  • No GPL-licensed DWG implementation source (LibreDWG, etc.) was consulted or imported.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • The corpus bytes and AutoCAD's own DXF exports of the pinned drawings (the oracle);
  • No reading of comments or code in any other project.

Developer Certificate of Origin

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

§20.4.101 prints TABLESTYLE; the notes that declined it said §20.4 had no
entry. Its until-R21 layout closes on its data-stream boundary on all 32
records of R14 to R2007 in the public corpus, and against AutoCAD's DXF
export all 1896 values of the 24 R2000 to R2007 records equal it.

Two readings come from the bits, not the spec's table: the data type, unit
type and format string are R2007+ together, and every colour is the 44-bit
TC on R2000 and R14 too. R2010 and later use §20.4.101.2's layout and stay
Unhandled.
@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-26T20:13:41.101292Z b59122f 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
DrunkOnJava enabled auto-merge (squash) October 26, 2026 20:15
@DrunkOnJava
DrunkOnJava merged commit c481ecb into main Oct 26, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the obj/tablestyle branch October 26, 2026 20:18
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
The TABLESTYLE decoder (#303) reads §20.4.101.1's layout on R2000 to
R2007; the oracle now compares each field with the group the section's
DXF column gives it: 3, 70, 71, 40, 41, 280 and 281, then per row style
(data, title, header) 140, 170, 62, 63, 283, on R2007 also 90, 91 and 1,
and per border 274-279, 284-289 and 64-69. The text style (7) is a
handle the decoder does not read and stays not-decoded; the colours are
TC and export as their index. Where an export writes two 280s before
the first row style (the R2010+ ones), the suppress-title flag is the
second, as the decoder's probe reads it.

On the 49 drawing pairs: 24 records, R2000 to R2007, all 1896 decoded
values equal AutoCAD's export, the count the decoder's own probe
reports. The 18 paired R2010+ records (§20.4.101.2) remain undecoded.
tools/oracle/baseline.tsv gains the 237 new rows, and the §20.4.101 row
of docs/spec-coverage.md says what the oracle measured.

Refs #99, #102, #151
DrunkOnJava added a commit that referenced this pull request Oct 26, 2026
The TABLESTYLE decoder (#303) reads §20.4.101.1's layout on R2000 to
R2007; the oracle now compares each field with the group the section's
DXF column gives it: 3, 70, 71, 40, 41, 280 and 281, then per row style
(data, title, header) 140, 170, 62, 63, 283, on R2007 also 90, 91 and 1,
and per border 274-279, 284-289 and 64-69. The text style (7) is a
handle the decoder does not read and stays not-decoded; the colours are
TC and export as their index. Where an export writes two 280s before
the first row style (the R2010+ ones), the suppress-title flag is the
second, as the decoder's probe reads it.

On the 49 drawing pairs: 24 records, R2000 to R2007, all 1896 decoded
values equal AutoCAD's export, the count the decoder's own probe
reports. The 18 paired R2010+ records (§20.4.101.2) remain undecoded.
tools/oracle/baseline.tsv gains the 237 new rows, and the §20.4.101 row
of docs/spec-coverage.md says what the oracle measured.

Refs #99, #102, #151
DrunkOnJava added a commit that referenced this pull request Oct 27, 2026
Resolved against main's squash of #303 (the TABLESTYLE R14 to R2007 commit this
stack carried): its decoder, probe and section stay main's, and this branch's
R2010 TABLESTYLE, CELLSTYLEMAP and cell-style reader sit beside them.

- src and examples: both sides kept; dispatch and the objects table list the
  modern TABLESTYLE and CELLSTYLEMAP arms next to main's.
- ARCHITECTURE.md: main's sections plus this branch's R2010 section as 7au;
  the duplicate until-R2007 section is main's 7ad.
- README.md: main's. spec-coverage: this branch's newer TABLESTYLE and
  CELLSTYLEMAP rows, regenerated.
- tools/corpus/baseline.tsv: regenerated by measurement; against main's it is
  decoded +52, skipped -52 and nothing else.
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.

1 participant