Skip to content

v4.0.0-beta.6

Pre-release
Pre-release

Choose a tag to compare

@gsdali gsdali released this 16 Oct 08:47
· 62 commits to main since this release
a947ed6

The 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 node BRep_Builder::Remove had freed. The call answers a shape or nil instead of killing the process.
  • 0065 (#3350): a chamfer whose two spine tangents are parallel answers nil instead of an uncatchable SIGSEGV. On the OCCT#1576 model, 12 of 36 edges crashed at distance 1 and all 36 now return nil.
  • 0066 (#3464): an arc-join Shape.thickSolid that removes the floor of a blind hole is a valid solid, where it was inside out in every build since 0053 and in a fraction of builds before it (OCCT#1600).
  • 0068 (#3449): Shape.evolvedAdvanced on a circular spine with a profile that leaves the circle's axis answers nil instead 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 on kernel.6 and none do with the patch.

wasm is on kernel.7 as well. Two wasm notes from #3477, both recorded in the repo:

  • OCAFMalformedKernelReadTests is excluded from the wasm test build. Its all-0xFF inputs make OCCT allocate by a file-declared size, malloc fails in 32-bit linear memory, and every later allocation in the process fails. It reproduces on the kernel.6 wasm 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 evolvedAdvanced circular-spine test is a listed known wasm failure: on wasm there is no length mismatch, so patch 0068 has nothing to throw on and the result is the same as on kernel.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.projectionMatrix and Camera.viewMatrix are the new Matrix4x4F; GProps.matrixOfInertia and ShapeProperties.momentOfInertia (and its init) are Matrix3x3D; DrawingAnnotation.CuttingPlaneLine.init is failable. Migration: node.transform.columnMajorElements, or simd_float4x4(t.column0, t.column1, t.column2, t.column3). OCCTMCP and OCCTSwiftScripts have three flatten helpers to update.
  • Shape.offsetWire(face:offset:) and OffsetAncestors.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.
  • circularPattern and circularPatternWithFullHistory step angle / (count - 1) for a partial angle (#3356), so the last copy lands at angle. A full circle is unchanged. To keep the old positions pass angle * Double(count - 1) / Double(count). Silent value change.
  • Bridge only: OCCTAx3Create and OCCTAx3CreateFromNormal gain 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 / 2 answered the unchanged cube, and both rims of a cylinder at r == R == H / 2 answered two solids with twice the volume. Both pass BRepCheck, so the #3200 guard could not see them. Every solid-blend entry point, and FilletBuilder.build() and ChamferBuilder.build(), now answer nil.
  • FilletBuilder.build() returns nil after resetContour(_:) left a radius-less contour, and setParams leaves the tolerances unchanged for a zero, negative or non-finite value (#3367, #3463).
  • The chamfer and fillet crashes above arrive with patches 0064 and 0065.

Correctness fixes

  • Refusals instead of garbage or hangs: Shape.offset(by:joinType:), Shape.offset(by:) and Shape.shelled(thickness:) refuse non-finite distances (#3455); Shape.offsetPerFace refuses 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 answers nil (#3360); isSelfIntersecting(hardTimeout:) with a non-positive bound answers nil at 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.faceCopy returns the face instead of nil (#3358); Shape.faceRestrictAlgo returns the face count instead of 0 (#3361); Shape.solidFromShells orients extra shells as cavities (#3359); Shape.orientClosedSolid writes the reversed solid back (#3357); transforms move a triangulation-only face, such as one from Shape.readSTL (#3388); Shape.connectedEdges and Shape.fixEdgeConnect() no longer leave the receiver invalid (#3354, #3252); Selector.pick returns hits instead of [] (#3254); CoordinateSystem3D.direction is the unit direction (#3371).
  • New: OffsetAncestors.offsetWire, so hasAncestor(_:) and ancestor(of:) can be given an edge of the offset wire (#3366), and Matrix4x4F, Matrix3x3D and DrawingDimension.Angular.isValid.
  • Lifetime: raw-handle arrays now keep their wrappers alive across the OCCT call at 77 sites (#3266, #3274), including the Shape.loft profiles 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 nil skips and fixture force-unwraps are converted to try #require (#3445, #3230). Compiler warnings in the test targets are cleared (#3470 to #3474).
  • Scripts/check-no-simd.py gates the simd removal in Sources/ and Tests/, 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.6 and 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 invalid br_table reproduces 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_Analyzer never returns on the IR branch for four fillets at r = 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 0031 and the BSpline adaptor cache), #2863 (an ASan-instrumented kernel), #3130 (the borrowed raw .handle of Edge, Wire and Face under 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).