Skip to content

feat(objects): decode ACDBASSOCPERSSUBENTMANAGER and ACDBPERSSUBENTMANAGER from AutoCAD's own DWG and DXF output (#152) - #379

Merged
DrunkOnJava merged 2 commits into
mainfrom
feat/perssubent
Oct 27, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
feat/perssubent

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Decodes ACDBASSOCPERSSUBENTMANAGER and ACDBPERSSUBENTMANAGER, the last two skipped types with no decoder and no open PR, on every release from R14 to R2018, and scores both in the DXF value oracle. ODA spec v5.4.1 prints no layout for either; the field lists are derived by the CLEANROOM.md method of 2026-10-26 from the data bits of the 14 corpus records against AutoCAD's own DXF export of the same handles: a BL version and arrays of BL (a BL count, then that many BL); the ASSOC adds an ids array, one array per id, one more array at version 2 and a final B (group 290).

Spec reference

None: §20.4 has no entry for either class, so there is no docs/data/spec-coverage.tsv row; a class row is added to docs/spec-coverage.md ("Classes the spec does not prescribe") as closes. Layout and evidence: ARCHITECTURE.md §7aq (provisional letter; the train renumbers). Per-class record: CLEANROOM.md (2026-10-27). Tracking: #152.

Corpus measurement (tools/corpus/measure.py run, then check against the regenerated baseline, over the 52 pinned drawings):

Decoded Skipped Errored
Before (main baseline) 15,527 547 0
After 15,541 533 0

+2 decoded and -2 skipped on each of sample_AC1014 to sample_AC1032 (7 drawings, 14 records), nothing else moves.

Evidence (cargo run --release --example probe_assoc_pers_subent -- ../dwg-corpus and probe_pers_subent):

Release Records Close Values compared Differ
R14 2 2 0 (no twin) 0
R2000 2 2 19 0
R2004 2 2 19 0
R2007 2 2 19 0
R2010 2 2 19 0
R2013 2 2 22 0
R2018 2 2 22 0
Total 14 14 120 0

Every group 90 of both DXF objects is compared with the decoded BLs in file order, their number included (so a shorter or longer decode fails on the count), and group 290 with the final B. The DXF value oracle scores both with the same pairing by handle: 64 and 44 values equal on six releases, 0 different, and the 12 groups left are the owner and reactor (330). tools/oracle/baseline.tsv gains 108 rows and loses none; the ratchet passes.

What the corpus cannot tell apart is listed, not hidden. All 14 records are one drawing (ACadSharp's sample_base, handles 0xD62 and 0xD63 on every release), so every field stays provisional (#348). Unverified by value:

  • Where each array ends. The DXF writes every number as group 90. The grouping (an ids array followed by one array per id, then at version 2 one more; three arrays after the PERS version) is the reading that keeps every repeat count in the stream and closes all 14 records. Readings that parse the same bits: a fixed number of arrays after the ids, the version-2 tail as a lone BL 0, the leading BL 3 (and PERS's BL 0) as a lone scalar.
  • What any value means.
  • Whether the version-2 array is gated by the version word or by the release (the word is 1 on R14 to R2010 and 2 on R2013 and R2018 in all seven ASSOC records).
  • The BL width: every value is under 256, so BS is bit-identical; the 32-bit form is never exercised.
  • The handles: the DXF writes none beyond the owner and one reactor, and none is decoded.

A version word the corpus does not hold (not 2 for the PERS, not 1 or 2 for the ASSOC) is refused with Error::Unsupported (reported as unhandled), never read on a guess.

README.md and STATUS.md are not refreshed here: tools/maintainer/readme_status.py is not on main yet (#376 adds it), so the integrator regenerates them after this lands.

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-features pass locally on this head
  • Shown working on real files: probe_pers_subent and probe_assoc_pers_subent over the 52 pinned drawings (14 records close, 120 values against the DXF twins, 0 differ); the oracle ratchet; measure.py check against the regenerated baseline
  • python3 tools/ci/spec_coverage.py --check and python3 tools/maintainer/train/arch.py check pass
  • No new unit tests. Tests touched: none.

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. This matters because dwg-rs is Apache-2.0 and must remain compatible.

My contribution is based on:

  • The ODA's freely-redistributable Open Design Specification for .dwg files (v5.4.1);
  • Public reverse-engineering notes, research papers, or blog posts cited inline;
  • Reading algorithm-description comments (not executable code) in permissively-licensed projects (MIT / Apache / BSD) to resolve spec ambiguities — disclose any such reading in this PR body so it can be recorded in CLEANROOM.md.

See CLEANROOM.md for the full allowed/forbidden source list and the honest scope of what "clean-room" means for this project.

For this PR specifically: the layouts come from AutoCAD's own output alone, by the method recorded in CLEANROOM.md (2026-10-26): AutoCAD-written DWG files compared with AutoCAD-written DXF exports of the same drawing, from the pinned public corpus (ACadSharp samples/sample_base; 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, and no algorithm-description comment of any project was read. No vocabulary beyond the DXF group codes and subclass markers in the twins and the class names in AcDb:Classes was used; version, ids and arrays are positional names of this crate's.

Developer Certificate of Origin

By submitting this PR, I certify that the contribution complies with the
Developer Certificate of Origin 1.1.
Specifically, I affirm that the contribution is my own work (or rightfully
licensed to me) and that it can be distributed under the project's Apache-2.0
license.

I will sign off commits with git commit -s when asked, which adds a
Signed-off-by trailer to the commit message asserting the DCO.

…NAGER from AutoCAD's own DWG and DXF output (#152)

ODA spec v5.4.1 prints no layout for either persistent-subentity manager. Derived by the
CLEANROOM.md method of 2026-10-26 from the data bits of the 14 corpus records (one per class
per release, R14 to R2018, all from ACadSharp's sample_base) against the object of the same
handle in the DXF export: a BL version, then arrays of BL (a BL count and that many BL); the
ASSOC adds an ids array, one array per id, one more array at version 2 and a final B. All 14
close on the data-stream boundary, from R2007 on an empty string stream, and 120 values equal
the DXF on R2000 to R2018 with 0 differences, the number of groups 90 included. The DXF writes
every number as group 90, so where each array ends, the meaning of every value, the BL width
(BS is bit-identical) and whether the version-2 array is gated by the version word or the
release are unverified by value; one drawing supplies all 14 records. A version word the
corpus does not hold is refused as unsupported. The DXF oracle scores both classes (108 new
rows, 0 different).
Baseline: decoded +2, skipped -2 on each of the seven sample_AC10xx drawings.
Tests touched: none; none added.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-27T12:07:14.176638Z bb6881a 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 27, 2026 12:09
@DrunkOnJava
DrunkOnJava merged commit 9292ba3 into main Oct 27, 2026
26 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/perssubent branch October 27, 2026 12:21
DrunkOnJava added a commit that referenced this pull request Oct 27, 2026
#379 decoded the last two skipped types that had no decoder in progress,
so every skipped type now has one in review, and #351 changed the
oracle's totals. readme_status.py re-renders both, and the CHANGELOG gets
the three 2026-10-27 entries the catch-up (#378) predates.
DrunkOnJava added a commit that referenced this pull request Oct 27, 2026
…red table from the baseline (#376)

* docs: bring README.md and RELEASE.md up to main, and render the measured table from the baseline

README.md still showed the 2026-10-26 measurement: 13,781 decoded, 308
errored, 85.7 %, with the errors tracked in four issues that are now
closed. main measures 15,527 decoded, 547 skipped and 0 errored on the
52 pinned drawings (96.6 %). The README now says that, lists the 30
skipped types with the open PR for each, gives the DXF value oracle's
totals, and brings the capability matrix, the streaming section, the
CLI list and the "does not do" list up to what has landed.

The table and the totals are rendered from tools/corpus/baseline.tsv by
tools/maintainer/readme_status.py (--write, --check). audit.py runs
the check, and docs/maintaining.md adds housekeeping item 10: refresh
the README after any landing that moves the baseline or ships a
capability. STATUS.md's coverage line uses the same blocks.

RELEASE.md cited a "#418" and "Q-07" that do not exist, listed five CLI
tools where release.yml builds seven, and promised "4 binaries on 3
platforms" where it ships seven on five targets. It now names the
twelve required checks and the README refresh as release steps.

* docs: the README names #374 as landed and #375 as what remains of code pages

* docs: render the DXF value oracle's totals from tools/oracle/baseline.tsv too

The README's oracle line was typed by hand and went stale when #351 landed:
105,690 equal fields became 105,756. readme_status.py now renders it from
the oracle baseline that CI pins, and --check covers it.

* fix(tools): readme_status requires every marker block in both documents

A STATUS.md edit that dropped or damaged its corpus-summary markers made
--check pass with stale numbers, and --write left them untouched. Each
document now lists the blocks it must carry. --check reports a block that
is missing or doubled, and --write refuses to run until it is fixed.

* docs: record #379 and #351, and re-render the numbers they moved

#379 decoded the last two skipped types that had no decoder in progress,
so every skipped type now has one in review, and #351 changed the
oracle's totals. readme_status.py re-renders both, and the CHANGELOG gets
the three 2026-10-27 entries the catch-up (#378) predates.
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