Skip to content

feat(#1393)!: retire Shape.splitDrafts, and carry no patch for it - #1657

Merged
gsdali merged 3 commits into
mainfrom
chore/1393-retire-splitdrafts
Sep 7, 2026
Merged

gsdali merged 3 commits into
mainfrom
chore/1393-retire-splitdrafts

Conversation

@gsdali

@gsdali gsdali commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

What & why

Shape.splitDrafts is removed, and patch 0034 is not carried. Both halves of that are the same
decision.

The operation cannot work on OCCT 8.0.1. LocOpe_SplitDrafts::Perform accepts only a planar
face, then pipes along the intersection of two planes, which is always an infinite Geom_Line, and
GeomConvert::CurveToBSplineCurve's untrimmed branch refuses an infinite curve by documented
design
(GeomConvert.hxx: "Raises DomainError if the curve C is infinite"). Every valid call
threw. Measured in Scripts/repro/1393-splitdrafts/.

The deciding fact is not the defect. Upstream deleted the class outright on 2026-08-07 in
OCCT#1442, a dead-header cleanup:
git grep SplitDrafts upstream/master returns nothing, and it had no caller anywhere in the OCCT
tree, not even a DRAW command, which is how a total defect survived to 8.0.1 unnoticed.

So there was no upstream PR to open, nothing to fix for anyone else's benefit, and a carried patch
would have been this project reviving a class its own maintainer had removed, with a guaranteed
expiry at the first kernel bump past that commit.
okf/policies/scope-boundary.md says stay faithful to OCCT.
Wrapping what OCCT has deleted is the opposite of that.

Closes #1393

CHANGELOG entry

Shape.splitDrafts is removed (#1393)

The operation could not succeed on any input. LocOpe_SplitDrafts accepts only a planar face and
then pipes along the intersection of two planes, always an infinite line, which
GeomConvert::CurveToBSplineCurve refuses by documented design, so every valid call threw and the
bridge returned nil.

It is removed rather than repaired because OCCT removed it first: the class was deleted upstream on
2026-08-07 in OCCT#1442 as dead code with no
caller in the OCCT tree. Carrying a kernel patch to revive it would have expired at the next repin
and could never have been filed upstream.

Gone with it: OCCTLocOpeSplitDrafts, its declaration and cross-reference index row, eleven unused
#includes, the reference-page section and the API_REFERENCE entry. The investigation is kept in
Scripts/repro/1393-splitdrafts/, including the GTest written for the upstream PR that could not
be filed, since it is the only executable statement of what a working LocOpe_SplitDrafts
produces.

SemVer impact

MAJOR. Shape.splitDrafts(faceIndex:wire:direction:planeOrigin:planeNormal:angle:) is removed, and
so is the C bridge's OCCTLocOpeSplitDrafts. Migration: there is none, and none is needed. The
function returned nil for every input on every shipped version, so no working call site can exist.
A caller that compiled against it was calling something that never did anything.

Checklist

  • New or changed behavior is covered by a unit test in the same PR: the test that covered it
    (Issue1393SplitDraftsTests, which asserted the refusal) is removed with the API. Nothing is
    left untested, because nothing is left.
  • Every new test and every new --self-test case was run once with its subject broken: no new
    tests.
  • The CHANGELOG entry above is complete, and docs/CHANGELOG.md is not in this diff.
  • The SemVer impact above is stated, and docs/SEMVER.md is not in this diff.

Notes for the reviewer

Verification: all ten static gates clean, including check-bridge-index (the cross-reference
index row is removed with the symbol) and count-operations (4,366 down to 4,365, re-derived across
README, docs/API_REFERENCE.md and docs/index.md). swift build clean, format-bridge.sh --check clean under the pinned clang-format 22.1.8, full suite green.

What is kept, deliberately. Scripts/repro/1393-splitdrafts/ stays, with an "Outcome" section
explaining the removal, and it gains upstream/LocOpe_SplitDrafts_Test.cxx, the GTest from the
closed PR #1627. That file is the only executable statement of what the operation should produce,
proven both ways against patched and unpatched kernels: IsDone=1, seven faces, one tilted by
exactly the requested draft angle, and a 10-unit cube's volume rising from 1000 to 1022.04 against
the wedge's analytic 22.04. If the class is ever restored, that is the head start; if not, it is the
record of what was measured before the wrapper went.

CLAUDE.md's Known OCCT Bugs list loses a line: the standing instruction to always wrap
LocOpe_SplitDrafts::Perform() in try/catch describes a call the bridge no longer makes. The
row in okf/references/known-occt-bugs.md stays and now records the disposition, because the defect
was real and the reasoning is worth keeping.

gsdali and others added 2 commits September 8, 2026 09:02
LocOpe_SplitDrafts cannot work on OCCT 8.0.1: it accepts only a planar face and
then pipes along the intersection of two planes, always an infinite line, which
GeomConvert refuses by documented design. Every valid call threw.

The deciding fact is not the defect. Upstream deleted the class outright on
2026-08-07 in OCCT#1442, a dead-header cleanup: no caller anywhere in the OCCT
tree, not even a DRAW command, which is how a total defect survived to 8.0.1
unnoticed. There was no upstream PR to open and nothing to fix for anyone
else's benefit, and a carried patch would have been this project reviving a
class its own maintainer had removed, with a guaranteed expiry at the first
kernel bump past that commit.

okf/policies/scope-boundary.md says stay faithful to OCCT. Wrapping what OCCT
has deleted is the opposite of that.

Removed: the Swift wrapper, the bridge function, its declaration and index row,
eleven now-unused includes, the reference-page section, the API_REFERENCE entry
and the refusal test. The reproducer stays: it is why the decision could be
made.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The upstream PR was impossible: the class it fixes no longer exists on OCCT
master. The GTest written for it is kept anyway, because it is the only
executable statement of what a working LocOpe_SplitDrafts produces, proven
against both a patched and an unpatched kernel.

Patch 0034 itself is not carried and exists only in the closed PR.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread Sources/OCCTSwift/Shape+Modeling.swift Outdated
@@ -2035,37 +2035,6 @@ extension Shape {

// MARK: - LocOpe_SplitDrafts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

WARNING: Orphaned MARK comment left after function removal

The // MARK: - LocOpe_SplitDrafts comment at line 2036 remains but the splitDrafts function it was marking has been completely removed. This orphaned marker should be deleted.

Suggested change
// MARK: - LocOpe_SplitDrafts

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (24 files)
  • CLAUDE.md - Known OCCT bugs list updated
  • README.md - Operation count updated (4,366 → 4,365)
  • Scripts/repro/1393-splitdrafts/README.md - Updated with removal rationale
  • Scripts/repro/1393-splitdrafts/upstream/LocOpe_SplitDrafts_Test.cxx - Added GTest from unfiled upstream PR
  • Sources/OCCTBridge/include/OCCTBridge.h - Cross-reference index row removed
  • Sources/OCCTBridge/include/OCCTBridge_Modeling.h - Bridge declaration removed
  • Sources/OCCTBridge/src/OCCTBridge.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Boolean.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Chamfer.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Features.mm - Function and include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Fillet.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_HLRProjection.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_HealingSewing.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Misc.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_ShapeToolsHistory.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_SolidPrimitives.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Sweep.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Transform.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_WireEdgeFaceBuilders.mm - Include removed
  • Sources/OCCTSwift/Shape+Modeling.swift - Swift wrapper removed (orphaned MARK comment also removed in follow-up commit)
  • Tests/OCCTModelingTests/Issue1393SplitDraftsTests.swift - Test file deleted
  • docs/API_REFERENCE.md - Entry removed, total count updated
  • docs/index.md - Operation count updated
  • docs/reference/Shape-Measurement.md - Documentation removed
  • okf/references/known-occt-bugs.md - Entry updated with disposition
Previous Review Summary (commit a418212)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit a418212)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
Sources/OCCTSwift/Shape+Modeling.swift 2036 Orphaned MARK comment left after function removal
Files Reviewed (24 files)
  • CLAUDE.md - Known OCCT bugs list updated
  • README.md - Operation count updated (4,366 → 4,365)
  • Scripts/repro/1393-splitdrafts/README.md - Updated with removal rationale
  • Scripts/repro/1393-splitdrafts/upstream/LocOpe_SplitDrafts_Test.cxx - Added GTest from unfiled upstream PR
  • Sources/OCCTBridge/include/OCCTBridge.h - Cross-reference index row removed
  • Sources/OCCTBridge/include/OCCTBridge_Modeling.h - Bridge declaration removed
  • Sources/OCCTBridge/src/OCCTBridge.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Boolean.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Chamfer.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Features.mm - Function and include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Fillet.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_HLRProjection.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_HealingSewing.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Misc.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_ShapeToolsHistory.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_SolidPrimitives.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Sweep.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_Transform.mm - Include removed
  • Sources/OCCTBridge/src/OCCTBridge_Modeling_WireEdgeFaceBuilders.mm - Include removed
  • Sources/OCCTSwift/Shape+Modeling.swift - Swift wrapper removed (with orphaned MARK comment)
  • Tests/OCCTModelingTests/Issue1393SplitDraftsTests.swift - Test file deleted
  • docs/API_REFERENCE.md - Entry removed, total count updated
  • docs/index.md - Operation count updated
  • docs/reference/Shape-Measurement.md - Documentation removed
  • okf/references/known-occt-bugs.md - Entry updated with disposition

Fix these issues in Kilo Cloud


Reviewed by nemotron-3-ultra-550b-a55b:free · Input: 236.4K · Output: 5.8K · Cached: 561.6K

Kilo review. The // MARK: - LocOpe_SplitDrafts heading outlived its only
member and sat over an unrelated History class, which is worse than no heading:
it labels the wrong thing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gsdali

gsdali commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed in 02306b3e. Correct, and worth more than a tidy-up: the // MARK: - LocOpe_SplitDrafts heading outlived its only member and came to sit over the unrelated History class, so it was not an orphan so much as a mislabel. grep -rn SplitDrafts Sources/ is now empty.

@gsdali
gsdali merged commit 4bac283 into main Sep 7, 2026
6 checks passed
@gsdali
gsdali deleted the chore/1393-retire-splitdrafts branch September 7, 2026 23:22
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.

LocOpe_SplitDrafts (Shape.splitDrafts) has zero test coverage anywhere; ground-truth construction is non-trivial

1 participant