Skip to content

Resolve the named root before synthesizing a Model layout - #122

Merged
HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
BjornFidder:fix-model-layout-root
Oct 19, 2026
Merged

HakanSeven12 merged 1 commit into
HakanSeven12:mainfrom
BjornFidder:fix-model-layout-root

Conversation

@BjornFidder

@BjornFidder BjornFidder commented Oct 19, 2026 •

Copy link
Copy Markdown

When a minimal DXF has an empty, handle-less DICTIONARY, reference resolution assigns it a handle after OBJECTS reading. ensure_model_layout then uses the stale named-root cache and synthesizes a layout dictionary owned by an absent object. An empty OBJECTS section can leave the same dangling ownership.

Resolve a unique existing root, or create one when none exists, before synthesizing the Model layout. Resolve ACAD_LAYOUT by its named membership instead of reusing an unrelated cached dictionary. Synchronize the root/layout caches and complete both membership and ownership. Null identities, ambiguous roots and conflicting named targets are not reused; conflicts produce a warning without replacing the source objects.

Regression tests cover empty and handle-less roots, repeated preparation, DXF read/write/read with unchanged LINE endpoints, unrelated cached metadata, null identities and conflicting/ambiguous source graphs. The tests stand independently of the separate existing-layout cache fix and require no external drawings.

Validation against upstream 5d4f11a (acadrust 0.6.4): cargo check --all-targets --all-features passes; cargo test --workspace passes 2001 tests including doctests; the all-features root/layout regressions pass 6 tests. The new regression tests fail on the unmodified current base and pass with this patch. Full all-features suites are also covered by the existing PR CI workflow.

The unmodified base already fails cargo fmt --all -- --check and cargo clippy --workspace --all-targets -- -D warnings on Rust 1.98. The final clippy error multiset matches that baseline; unrelated formatting/lint changes are excluded from this PR.
Related independent fix: #121 resolves the existing-layout DXF dictionary cache. Neither PR depends on the other.

@HakanSeven12
HakanSeven12 merged commit d5ce8e5 into HakanSeven12:main Oct 19, 2026
4 checks passed
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.

2 participants