Skip to content

feat(objects): decode VIEWPORT ENTITY HEADER from §20.4.70 (#146) - #311

Merged
DrunkOnJava merged 8 commits into
mainfrom
obj/vp-ent-hdr
Oct 28, 2026
Merged

DrunkOnJava merged 8 commits into
mainfrom
obj/vp-ent-hdr

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Decode VIEWPORT ENTITY HEADER (type 0x47, §20.4.70): the name and flags a symbol-table entry opens with (TV, B, BS, B) and one more B. Only R14 and R2000 drawings hold one; it had no decoder, so all 6 corpus records were skipped.

Spec reference

§20.4.70 VIEWPORT ENTITY HEADER (tracking #146). The field list closes as printed. The handle references (control object, extension dictionary, xref block, the viewport entity, the previous header) are in the handle stream and are not read. The spec's own R14 example (§20.4.70.1) now closes on its boundary too: spec_examples --update moved that row from unhandled to closes (tests/fixtures/spec-examples/r14-objects.tsv, docs/data/spec-coverage.tsv, docs/spec-coverage.md).

Test plan

  • cargo fmt --all -- --check and cargo clippy --all-targets --all-features -- -D warnings pass on this branch. cargo test, cargo doc and the 1.85 MSRV check run once on a merge of this lane's open branches instead of per branch (the machine is at memory pressure red); the result goes in a comment.

  • Shown on real files, no new unit tests: cargo run --release --example probe_vp_ent_hdr -- <corpus> over the 52 pinned drawings.

    Release Records Close Values compared with a DXF
    R14 3 3 no twin (boundary only)
    R2000 3 3 none: the DXF holds no such record

    This is boundary evidence alone. AutoCAD's DXF exports of the corpus hold no record for the header (R14 is exported to R12 DXF, which has no OBJECTS section; R2000's tables have no viewport entity table), so no value can be compared. The probe prints each record's name and flags.

  • Corpus baseline regenerated: decoded +6, skipped -6, errored unchanged (2 rows).

  • Tests touched: none. examples/probe_vp_ent_hdr.rs and the shared harness examples/support/twin.rs are new examples, not tests.

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.

The header the older releases keep for each viewport entity is the name and
flags a symbol-table entry opens with plus one more flag. It had no decoder,
so all 6 records of the corpus (R14 and R2000) were skipped; all 6 close on
their data-stream boundary, and so does the spec's own R14 example
(§20.4.70.1).

AutoCAD's DXF exports of the corpus hold no record for the header, so the
evidence is the boundary alone.
@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-28T17:52:13.307575Z 3ab4a09 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.

… the list sits apart from its siblings' (rustfmt sorts the list)
Resolved by keeping both sides: the VIEWPORT ENTITY HEADER section joins
ARCHITECTURE.md after main's sections as 7au; examples/support/twin.rs is
main's (this branch's copy differed only in a private Twin::parse); the
spec-coverage page is regenerated. tools/corpus/baseline.tsv is main's; the
Corpus job measures the count change and the baseline is regenerated from its
artifact.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9338d80701

ℹ️ 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".

Comment thread src/entities/dispatch.rs Resolved
…RT ENTITY HEADER (#146)

Regenerated with measure.py baseline from the corpus-measurement artifact of the
Corpus (public DWG) job on 9338d80. Against main: decoded +6, skipped -6, every
other column unchanged (the corpus's 6 VIEWPORT ENTITY HEADER records).
@DrunkOnJava DrunkOnJava added type:feature New capability, including a spec section not yet implemented area:objects Common object formats and non-graphical objects (§20.1 to §20.3, §20.4 objects, §28) labels Oct 28, 2026
DrunkOnJava added a commit that referenced this pull request Oct 28, 2026
…till skipped (#424)

CHANGELOG gains the table objects (#313, #316, #317, #319), the nineteen classes derived from
AutoCAD's output (#326 to #341), the DIMENSION scorer (#387), the BLOCK fixtures (#407), the
maintainer tools (#406, #383) and the merge train's stack handling (#421 to #423). README said every
skipped type had a decoder in review; only SHAPE (#310) and the VIEWPORT entity header (#311) do,
and the rest are twelve custom classes in the BookViewerApp3 drawings with no DXF export yet, now
named. STATUS's pending section says its counts are the 2026-08-30 snapshot.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 28, 2026 17:57
@DrunkOnJava
DrunkOnJava merged commit 846e39b into main Oct 28, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the obj/vp-ent-hdr branch October 28, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:objects Common object formats and non-graphical objects (§20.1 to §20.3, §20.4 objects, §28) type:feature New capability, including a spec section not yet implemented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant