← Back to Pull requests

DWG: keep opaque registered entities and their source classes #2654

Closed
unknown closed this pull request without merging on Nov 08, 2026 15:44 UTC
View on GitHub
unknown unknown commented on Nov 02, 2026 18:32 UTC
Author

DWG import can drop opaque registered entities because the intermediate DXF gives them an unresolved class number. Convert them to standard proxies, preserving payload bit counts, graphics, references and separate string streams.

Keep the source CLASSES order, duplicate names and metadata through DXF writes, and through DWG writes of 2013 and later. When the bridge DXF's classes can't be written back as they are (before 2013, a binary DXF, a malformed CLASS), main's proxy_classes handles the proxies: matched by name, or left out and counted as unwritten. A proxy whose number names no class is left out and counted. No path returns an error for a proxy, so a pre-2013 DWG saves without them, as the save report says.

On read, a registered entity with decoded properties and opaque data stays as read (as on main) and a read note names it. dwg stays standalone: the source classes are read from the bridge's ASCII DXF by a bounded scan, like main's dxf_class_names; no layering change.

Tests: focused DWG/IO/engine tests, clippy -D warnings, fmt, layers and the wasm32 check of cadcraft-io pass.

Addresses #2643; overlaps the class-ID work in #2471. Source-version handling, rendering (#1361) and native parameter editing are outside this PR; another application's objects are #2917. Not yet opened in AutoCAD.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

Bug Fixes
Improved preservation of proxy objects and registered entities across DXF and DWG conversions, including class identity, graphics, payload data, and object references.
Preserved proxy class information across repeated saves when the source class table is available, reducing the risk of data loss or incorrect class associations.
Standardized proxy record names when converting DXF data for the DWG bridge; ordinary DXF output remains unchanged.
* Improved handling of ambiguous class names and malformed unused class records, helping prevent them from interfering with other geometry.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 269 lines (+201 / -68) across 3 files Reviewer: mkzung Review duration: 8472m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 269 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.335
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2654"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.4% (MEDIUM) · Higher = larger blast radius
39.4%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.6% · Safe to merge
15.6%