Repository navigation
v4.0.0-beta.6
Pre-releaseThe beta that pins v4.0.0-kernel.7 and takes Apple's simd off the public surface. Since v4.0.0-beta.5 156 pull requests have merged: five more carried kernel patches on both platforms, one compile-breaking API change, two silent value changes in offset and pattern results, a group of measured correctness fixes, and a large test-quality lift.
Kernel: v4.0.0-kernel.7
OCCT V8_0_1 plus 50 carried patches (0010 to 0069, retired numbers absent), native and wasm, built from the same commit and attached to the same release. Scripts/check-wasm-kernel-parity.py reports the two clean with no acknowledgement standing. Five patches are new since kernel.6:
0064(#3335): fillets whose ends meet in the merge no longer read a list nodeBRep_Builder::Removehad freed. The call answers a shape ornilinstead of killing the process.0065(#3350): a chamfer whose two spine tangents are parallel answersnilinstead of an uncatchable SIGSEGV. On the OCCT#1576 model, 12 of 36 edges crashed at distance 1 and all 36 now returnnil.0066(#3464): an arc-joinShape.thickSolidthat removes the floor of a blind hole is a valid solid, where it was inside out in every build since0053and in a fraction of builds before it (OCCT#1600).0068(#3449):Shape.evolvedAdvancedon a circular spine with a profile that leaves the circle's axis answersnilinstead of aborting the process.0069(#3330): a damaged binary OCAF file is reported through the reader status instead of a null-header SIGSEGV or a section loop that never ends. Of 1586 generated damaged files, 137 killed the process onkernel.6and none do with the patch.
wasm is on kernel.7 as well. Two wasm notes from #3477, both recorded in the repo:
OCAFMalformedKernelReadTestsis excluded from the wasm test build. Its all-0xFF inputs make OCCT allocate by a file-declared size,mallocfails in 32-bit linear memory, and every later allocation in the process fails. It reproduces on thekernel.6wasm archive too, so it is the inputs and not this repin. Native 64-bit passes. A consumer in a browser opening an untrusted OCAF file can lose the module's allocator; #3477 is open for the bound-the-size fix.- The
evolvedAdvancedcircular-spine test is a listed known wasm failure: on wasm there is no length mismatch, so patch0068has nothing to throw on and the result is the same as onkernel.6.
Breaking, in docs/SEMVER.md with migrations
v4.0.0 is a major by SemVer Rule 2, and these are recorded for it.
- The package no longer depends on Apple's
simd(#2759, #3291).AssemblyNode.transform,Camera.projectionMatrixandCamera.viewMatrixare the newMatrix4x4F;GProps.matrixOfInertiaandShapeProperties.momentOfInertia(and itsinit) areMatrix3x3D;DrawingAnnotation.CuttingPlaneLine.initis failable. Migration:node.transform.columnMajorElements, orsimd_float4x4(t.column0, t.column1, t.column2, t.column3).OCCTMCPandOCCTSwiftScriptshave threeflattenhelpers to update. Shape.offsetWire(face:offset:)andOffsetAncestors.create(face:offset:joinType:)offset outward for a positive offset (#3364, #3366). The sign was the opposite of the documented one. A caller that negated the offset to compensate should stop negating. Silent value change.circularPatternandcircularPatternWithFullHistorystepangle / (count - 1)for a partial angle (#3356), so the last copy lands atangle. A full circle is unchanged. To keep the old positions passangle * Double(count - 1) / Double(count). Silent value change.- Bridge only:
OCCTAx3CreateandOCCTAx3CreateFromNormalgain three output parameters for the unit direction (#3371).
Fillet and chamfer
- Two more valid-but-wrong answers are refused (#3297, #3298, #3462). A cube chamfered at
d == edge / 2answered the unchanged cube, and both rims of a cylinder atr == R == H / 2answered two solids with twice the volume. Both passBRepCheck, so the #3200 guard could not see them. Every solid-blend entry point, andFilletBuilder.build()andChamferBuilder.build(), now answernil. FilletBuilder.build()returnsnilafterresetContour(_:)left a radius-less contour, andsetParamsleaves the tolerances unchanged for a zero, negative or non-finite value (#3367, #3463).- The chamfer and fillet crashes above arrive with patches
0064and0065.
Correctness fixes
- Refusals instead of garbage or hangs:
Shape.offset(by:joinType:),Shape.offset(by:)andShape.shelled(thickness:)refuse non-finite distances (#3455);Shape.offsetPerFacerefuses entries OCCT would merge into one offset (#3365); the evolved builders refuse inputs that never returned and the empty shapes they answered (#3368);Shape.shell(from:)on a half-infinite surface answersnil(#3360);isSelfIntersecting(hardTimeout:)with a non-positive bound answersnilat once (#3256); an out-of-range vertex index in the BRepGraph supplement attach is refused (#3394);Document.loadOCAF(from:)returns(nil, .driverFailure)for an empty, non-OCAF or damaged file (#3318). - Wrong answers corrected:
Shape.faceCopyreturns the face instead ofnil(#3358);Shape.faceRestrictAlgoreturns the face count instead of0(#3361);Shape.solidFromShellsorients extra shells as cavities (#3359);Shape.orientClosedSolidwrites the reversed solid back (#3357); transforms move a triangulation-only face, such as one fromShape.readSTL(#3388);Shape.connectedEdgesandShape.fixEdgeConnect()no longer leave the receiver invalid (#3354, #3252);Selector.pickreturns hits instead of[](#3254);CoordinateSystem3D.directionis the unit direction (#3371). - New:
OffsetAncestors.offsetWire, sohasAncestor(_:)andancestor(of:)can be given an edge of the offset wire (#3366), andMatrix4x4F,Matrix3x3DandDrawingDimension.Angular.isValid. - Lifetime: raw-handle arrays now keep their wrappers alive across the OCCT call at 77 sites (#3266, #3274), including the
Shape.loftprofiles whose release-build crash showed in threaded holes (#3261, #3267).
Tests and tooling
- The strengthened assertions on the v5 branch (#766, #2983) are lifted onto
main, and the SEVERE-rated weak tests of every domain target are re-swept and pinned to measured values (#3332). - Test files are organised into area directories and named for what they cover (#3147, #3327), issue numbers are taken out of test names, and silent
nilskips and fixture force-unwraps are converted totry #require(#3445, #3230). Compiler warnings in the test targets are cleared (#3470 to #3474). Scripts/check-no-simd.pygates thesimdremoval inSources/andTests/, and the area tables name the SIMD helper (#3308). CI retries the Swift SDK install when the installer aborts (#3083), and the census gain comparison no longer reports false positives (#3301).- Upstream OCCT evidence for the open fillet and chamfer set was replayed on
kernel.6and on the IR branch, and the OCCT#1568 opposite-edge family has DRAW cases and images (#3334, #3353, #3443). #2757 was re-checked upstream: the invalidbr_tablereproduces on LLVM 23.1.3 and trunk (#3290).
Known open items
- wasm: #3477 (a malformed binary OCAF file poisons the 32-bit allocator) is open; #2757 (setjmp plus wasm exceptions in one function emits an invalid
br_table) is open upstream. - Fillets and chamfers: the defect set tracked under #3334 is open, from #3336 to #3352 (including #3428, where
BRepCheck_Analyzernever returns on the IR branch for four fillets atr = w/2). Each is a kernel result that is done and invalid, or declined, with the upstream OCCT issue or PR cited in the issue. - Held: #3065 (patch
0031and the BSpline adaptor cache), #2863 (an ASan-instrumented kernel), #3130 (the borrowed raw.handleofEdge,WireandFaceunder optimised builds), #1403 (per-format STEP controller singleton ownership). - The CHANGELOG entries for #3350, #3464, #3449 and #3330 were written before the repin and still say "takes effect at the next kernel repin"; they are live in this release.
Still a pre-release
v4.0.0 is a major by SemVer Rule 2. The breaks are listed with migrations in docs/SEMVER.md, and the full history is in docs/CHANGELOG.md.
Verification
CHANGELOG audited with --verify-transcribed since v4.0.0-beta.5: 156 merges, 30 transcribed, 126 opted out, 0 with no entry. Both kernel pins checked by check-wasm-kernel-parity.py, clean with no acknowledgement, and Package.swift's checksum: equals the published digest of OCCT.xcframework.zip on v4.0.0-kernel.7. Every static gate in gate-scripts and its --self-test exit 0, and swiftlint lint --strict, check-swift-format.py and format-bridge.sh --check exit 0. Operation count derives 4,403 and agrees with every headline (1,193 bridged OCCT headers). Full swift test against v4.0.0-kernel.7: 7022 tests in 1664 suites passed with 6 known issues, in CI on the release merge commit a947ed6a4 (macOS).