← Back to Pull requests

DXF/DWG: prune kept ACDBASSOCDEPENDENCY objects whose target handle is unmapped #3426

Closed
unknown closed this pull request without merging on Nov 24, 2026 22:23 UTC
View on GitHub
unknown unknown commented on Nov 23, 2026 21:19 UTC
Author

When dxf_raw::finish remaps handles on kept associative objects, a dangling dependentOnObject pointer (the first group 330 inside the AcDbAssocDependency subclass) was rewritten to "0" while the dependency remained active and stayed listed in the owning ACDBASSOCACTION group-360 dependency list. Because the null handle cannot carry a persistent reactor ({ACAD_REACTORS), other CAD readers flag such dependencies as missing their reactor on the dependent-on object and mark them invalid.

dxf_raw::finish now drops any kept AcDbAssocDependency whose non-null dependentOnObject handle does not resolve to a written object or entity (along with kept objects owned only by that dependency, such as a dependency body), while leaving originally unbound dependencies (330 = 0 in the input) untouched. In Map::object, AcDbAssocAction filters dropped handles out of its 360 dependency list and updates the preceding 90 dependency count accordingly.

Tests


  • assoc_dependency_prune::orphaned_assoc_dependency_is_pruned_along_with_action_entry_and_body

  • assoc_dependency_prune::originally_unbound_assoc_dependency_with_null_target_is_kept

  • cargo fmt --check, cargo clippy -p cadcraft-io --all-targets -- -D warnings, cargo test -p cadcraft-io --lib
  • <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    DXF output now omits associative dependencies whose target objects are not included in the output, along with objects owned by those dependencies.
    Association actions retain only valid dependency references, and their dependency counts are updated accordingly.
    Dependencies with null targets remain in the output, and surviving entries retain their original group codes.
    * Dependencies referenced by actions with unrecognized dependency-list layouts are not pruned based on those lists.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 251 lines (+188 / -63) across 3 files Reviewer: rahul05ranjan Review duration: 1503m
    All Vouch review confidence checks passed
    Residual risk 0.15 = 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 · 251 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.331
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3426"
    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% (MEDIUM) · Higher = larger blast radius
    39%
    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.4% · Safe to merge
    15.4%