fix(#794): factor shared scaffolding for 4 sibling-entry-point pairs - #935
Conversation
…e from manifest Fixes code-style CI failure on PR #935.
- Restore style-manifest-bridge.txt to match origin/main - Remove only the two touched files (OCCTBridge_Modeling.mm, OCCTBridge_Mesh.mm) from manifest - clang-format all non-manifest files All gate scripts pass, clang-format clean, build passes.
Code-Style CI FixedThe Changes:
Verification:
The PR should now pass the |
Review of PR #935 (all three commits) — no earlier review existed on this PR, so this covers the full stack, not just the deltaReviewed at head The factoring — verified ✅Fillet/Chamfer history queries ( Mesh booleans ( Sweeps — verified format-only ✅ (method corrected)Transparency note: the token-comparison script I used on #932/#933/#934 had a comment-stripping bug that made its "IDENTICAL" verdicts vacuous (the conclusions were still true, backed by green CI — I've re-run them all with the corrected script and every one still holds). With the corrected method for this PR:
🔴 The blocker: unrelated
|
- FilletBuilder Generated/Modified: shared occtFilletBuilderHistoryQuery helper - ChamferBuilder Generated/Modified: shared occtChamferBuilderHistoryQuery helper - Mesh Union/Subtract/Intersect: shared occtMeshBoolean helper Eliminates duplicated setup/extraction scaffolding following the pattern established by buildTrsf3D/buildSurfaceFromElementary/countOrCollectSharedEdges.
…e from manifest Fixes code-style CI failure on PR #935.
- Restore style-manifest-bridge.txt to match origin/main - Remove only the two touched files (OCCTBridge_Modeling.mm, OCCTBridge_Mesh.mm) from manifest - clang-format all non-manifest files All gate scripts pass, clang-format clean, build passes.
- Restore style-manifest-bridge.txt to match origin/main - Remove OCCTBridge_Mesh.mm from manifest (touched by this PR) - clang-format all changed files All 6 gate scripts clean, build passes.
3947135 to
fa60aae
Compare
| OCCTShapeRef shape, | ||
| OCCTShapeRef** outShapes) | ||
| // #794: shared helper for ChamferBuilder history queries (Generated/Modified) | ||
| static int32_t occtChamferBuilderHistoryQuery( |
There was a problem hiding this comment.
WARNING: ChamferBuilder helper assigns to *outShapes before the loop and doesn't check malloc result, unlike FilletBuilder helper
The FilletBuilder helper (occtFilletBuilderHistoryQuery, lines 14324-14332) correctly:
- Uses a local variable
shapes - Checks malloc result (
if (!shapes) return 0;) - Only assigns to
*outShapesafter the loop completes
But the ChamferBuilder helper (occtChamferBuilderHistoryQuery, line 14399) incorrectly:
- Assigns directly to
*outShapesbefore the loop - Doesn't check malloc result
- If
new OCCTShape{*it}throws mid-loop, the caller sees a partially-filled array via*outShapes
This is an exception-safety bug introduced by the refactoring. The ChamferBuilder helper should match the FilletBuilder pattern:
OCCTShapeRef* shapes = (OCCTShapeRef*)malloc(count * sizeof(OCCTShapeRef));
if (!shapes)
return 0;
int32_t i = 0;
for (auto it = list.cbegin(); it != list.cend(); ++it, ++i)
{
shapes[i] = new OCCTShape{*it};
}
*outShapes = shapes;Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Reviewed by nemotron-3-ultra-550b-a55b:free · Input: 229.4K · Output: 14K · Cached: 2M |
What & why
A census from the #784 duplication rescan found 11 bridge sibling-entry-point pairs that share setup/extraction scaffolding but not implementation. Each pair differs only in the one OCCT call or constructor overload in the middle, with no shared helper factoring the common part.
This PR addresses 4 of the 11 pairs:
OCCTFilletBuilderGenerated/OCCTFilletBuilderModifiedGenerated()vsModified()OCCTChamferBuilderGenerated/OCCTChamferBuilderModifiedGenerated()vsModified()OCCTMeshUnion/OCCTMeshSubtract/OCCTMeshIntersectThis is the same shape that let #761's buffer cap and PR #768's dropped alpha channel survive - just without (yet) a known behavioral divergence.
Changes
occtFilletBuilderHistoryQueryhelper taking a member function pointerocctChamferBuilderHistoryQueryhelper taking a member function pointerocctMeshBooleanhelper taking a function pointerAll are internal refactors; none change a public signature.
Verification
swift build --target OCCTModelingTestssucceedsclang-format --dry-run --Werror: cleanSemVer impact
PATCH. Purely internal refactoring - no signature changes, same behavior.