Skip to content

fix(#585): validate carried kernel patches against the patched kernel in CI - #586

Merged
gsdali merged 1 commit into
refactor/381-pass1bfrom
fix/585-kernel-integration-ci
Jul 31, 2026
Merged

fix(#585): validate carried kernel patches against the patched kernel in CI#586
gsdali merged 1 commit into
refactor/381-pass1bfrom
fix/585-kernel-integration-ci

Conversation

@gsdali

@gsdali gsdali commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • ci.yml's macOS check always resolves Package.swift's pinned, released OCCT.xcframework — a PR carrying a kernel patch not yet in a release, with a regression test for its fixed behaviour, fails that check indistinguishably from a real regression. chore(#512) + fix(#518, #555, #522): rebuild the kernel, redesign 0016 after upstream review, add 0018 and 0019 #519 hit this exactly and needed a manual investigation to tell "expected structural gap" apart from "the patch is broken."
  • New kernel-integration.yml, path-filtered to Scripts/patches/** and Scripts/build-occt.sh (ordinary PRs stay on the fast ci.yml path): rebuilds OCCT from source, cached by patch-set hash so only the first run after a patch change pays the full ~30-60 min cost, then runs swift test against that binary instead of the pinned release.
  • Fulfils what the old ci.yml comment already named and never built — a kernel-rebuild.yml that never existed anywhere in this repo's history.
  • ci.yml's comment updated to point at the new workflow instead of describing the rebuild as manual-only; docs/guides/building-occt.md updated in both places it discussed CI/kernel-rebuild interaction.

Closes #585.

Test plan

  • Both workflow YAML files parse cleanly (yaml.safe_load).
  • Scripts/count-operations.py unaffected (no Swift API change).
  • No Swift/bridge code touched — docs + CI config only, so no local build/test run.
  • First live run of kernel-integration.yml on this PR itself (it touches Scripts/build-occt.sh's neighbourhood only via docs, not the script — will confirm the path filter and cache key behave correctly on the next PR that actually touches Scripts/patches/).

… in CI

ci.yml's macOS check always resolves Package.swift's pinned, released
OCCT.xcframework, since a clean checkout has no local Libraries/. A PR
carrying a kernel patch not yet in a release, with a regression test for
its fixed behaviour, fails that check indistinguishably from a real
regression - #519 hit this exactly and needed a manual dig to tell the
two apart.

New kernel-integration.yml, path-filtered to Scripts/patches/** and
Scripts/build-occt.sh so ordinary PRs stay on the fast ci.yml path:
rebuilds OCCT from source (cached by patch-set hash, so only the first
run after a patch change pays the ~30-60 min cost) and runs swift test
against that binary instead of the pinned release. Fulfils what the old
ci.yml comment already named and never built: a "kernel-rebuild.yml"
that never existed anywhere in this repo's history.

Closes #585.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gsdali
gsdali merged commit 22cb17f into refactor/381-pass1b Jul 31, 2026
1 of 2 checks passed
@gsdali
gsdali deleted the fix/585-kernel-integration-ci branch July 31, 2026 06:57
gsdali added a commit that referenced this pull request Jul 31, 2026
…ness

Merging with the macOS CI check red, same known kernel-pin gap as #519/#576/#586 — refactor/381-pass1b's tip permanently carries #519's regression tests until a release bumps Package.swift's pin. Confirmed via local run against the actual patched kernel: exactly the same 23-issue Issue522/Issue491 signature, nothing new from this PR (which is comment/docs-only in OCCTBridge.h + a tooling script).

Two conflicts resolved during merge, both stale-branch artifacts (this PR's branch predates #507/#508's already-merged fixes to the same two OCCTBridge.h index entries) — kept the already-more-complete HEAD content in both spots, verified via `check-bridge-index.py` (0 stale, 5/5 self-test) after resolution. Third conflict in check-bridge-index.py itself: kept #510's continuation-line-aware parser (a strict superset of the current parenthetical-stripping one, already implied by the file's own already-merged docstring).
gsdali added a commit that referenced this pull request Jul 31, 2026
Merging with the macOS CI check red, same known kernel-pin gap as #519/#564/#576/#586. Confirmed locally against the actual patched kernel: exactly the same 23-issue Issue522/Issue491 signature, nothing new.

Clean cherry-pick, zero conflicts. Verified with the PR's own new check-null-handle-guards.py: "All bridge functions guard the geometry handle as well as the wrapper pointer."
gsdali added a commit that referenced this pull request Jul 31, 2026
…adius

Merging with the macOS CI check red, same known kernel-pin gap as #519/#564/#574/#576/#586.

Resolved the predicted trivial conflict with #574 in OCCTGeom2dGccCirc2dTanOnRad: both PRs insert an independent guard as the function's first statement (null-handle from #574, zero-radius from #575), kept both. Verified post-merge: all 22 of this PR's own tests pass (including the merged function's own case), and check-null-handle-guards.py still reports clean (#574's fix intact).
gsdali added a commit that referenced this pull request Jul 31, 2026
kernel-integration.yml (added an hour ago, #586) fails on every cache miss
before it reaches the patch it exists to validate:

  ./Scripts/build-occt.sh: line 71: cd: .../Libraries: No such file or directory

Libraries/ is gitignored in its entirety, so a clean checkout does not have it,
and actions/cache does not create the path on a miss. Since a cache miss is
exactly what a new or changed patch produces, the workflow could not have passed
for any kernel-patch PR. #532 is the first PR to trigger it. Reproduced on a
scratch layout matching a clean checkout: stock script dies on line 71 with the
same message, patched script creates the directory, clones OCCT, configures and
starts compiling.

The mkdir goes in build-occt.sh rather than the workflow, because the script's
own first-run contract is the same for anyone building locally from a fresh
clone.

Second defect, silent rather than fatal: the job restores
~/Library/Caches/org.swift.swiftpm, which caches the manifest *evaluation*,
including the `useLocalBinary` filesystem probe that ran before
Libraries/OCCT.xcframework existed. A restored cache makes SwiftPM keep
resolving the pinned released kernel, so the job would validate the wrong binary
and report green -- the failure mode this workflow was built to prevent, wearing
a passing tick. Measured on #532: touching Package.swift, deleting
.build/artifacts/*/OCCT, `swift package resolve` and a full `swift package
reset` all failed to dislodge it. `OCCTSWIFT_LOCAL=1` -- the override
Package.swift already documents -- is what works, so the test step now sets it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gsdali added a commit that referenced this pull request Jul 31, 2026
kernel-integration.yml (added an hour ago, #586) fails on every cache miss
before it reaches the patch it exists to validate:

  ./Scripts/build-occt.sh: line 71: cd: .../Libraries: No such file or directory

Libraries/ is gitignored in its entirety, so a clean checkout does not have it,
and actions/cache does not create the path on a miss. Since a cache miss is
exactly what a new or changed patch produces, the workflow could not have passed
for any kernel-patch PR. #532 is the first PR to trigger it. Reproduced on a
scratch layout matching a clean checkout: stock script dies on line 71 with the
same message, patched script creates the directory, clones OCCT, configures and
starts compiling.

The mkdir goes in build-occt.sh rather than the workflow, because the script's
own first-run contract is the same for anyone building locally from a fresh
clone.

Second defect, silent rather than fatal: the job restores
~/Library/Caches/org.swift.swiftpm, which caches the manifest *evaluation*,
including the `useLocalBinary` filesystem probe that ran before
Libraries/OCCT.xcframework existed. A restored cache makes SwiftPM keep
resolving the pinned released kernel, so the job would validate the wrong binary
and report green -- the failure mode this workflow was built to prevent, wearing
a passing tick. Measured on #532: touching Package.swift, deleting
.build/artifacts/*/OCCT, `swift package resolve` and a full `swift package
reset` all failed to dislodge it. `OCCTSWIFT_LOCAL=1` -- the override
Package.swift already documents -- is what works, so the test step now sets it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant