Repository navigation
native: re-export kore-rt where a relayed wake reaches its waiter alone - #35
SnowCheetos wants to merge 8 commits into
Conversation
…aiter alone ## Why Managed threads hold no send into each other's doorbells, so a futex wake between two of them, such as a C mutex unlock or a condition signal between two pthreads, is relayed through kore-rt's thread controller. The relay was a count. The controller answered every relay by kicking every thread with any doorbell waiter registered, so every relayed wake woke every parked thread in the program. Kore `b67f198` makes the relay name the threads it is for, and that arrives here through the exporter rather than as edits to the snapshot. ## What - `futex`: `Hub::relay(bands)` owes the hub the bands of the doorbell waiters its waker found and could not kick, before the hub's word moves. `wake` owes its first such waiter, `wake_all` all of them and `wake_thread` its target. `futex::deliver` kicks each owed band that still has a doorbell waiter registered, and never the hub itself. - `thread_controller`: the parking controller takes what it is owed after reading its word and before parking on it (`Hub::take_owed`), and delivers it. `Owner::swept` is gone. - The services' `boot.toml` digests are Kore's reseal over the change. - `docs/runtime.md` says what a relayed wake between two managed threads costs: a kick into the controller and one out, however many threads are parked. `docs/provenance.md` records the export and Kore's metal evidence. The closure keeps its 26 packages and 382 files. No exported manifest changed, so `native/Cargo.lock` did not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
Brings in ft/brave-heisenberg-zgoaux up to `c911ef1`, whose export records Kore `40de2582`: a managed thread runs its callback only once its founding is published, so it is reached from its first wait. `native/` is not merged by hand. `tools/sync-native.py` re-exports it at Kore `7b9bd96`, the merge of that founding wait into the targeted relay, over this side's recorded export (Kore `920526a`). Against this side it adds the founding wait to `thread_controller.rs`. Against that side it adds the targeted relay to `futex.rs` and `thread_controller.rs`, and the five services' `boot.toml` digests of the reseal over it (`920526a`), which the founding wait leaves as they were. `docs/provenance.md` keeps that branch's paragraph at the end of "A cancellation is a wake" and restates "A relayed wake reaches its waiter alone" for the new revision. `docs/runtime.md` merges as is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
Kore's reseal over the export at `7b9bd96` (`e0717eb`, built from `d64b7a5`, which pins `a2561bb`) repeats the turns step's A/B on the merged tree. With the targeted relay, every step ran to `exit 42` and no wake reached the parked thread. With the futex and controller of `36b99426`, which count and sweep, it was woken 206 times and the tour failed that step. The two-thread bound the step runs under is this stack's: Kore #1494's later `2a0730d` gives the controller's children their founder's arena, which lifts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
Brings in ft/brave-heisenberg-zgoaux up to `c839547`: its re-exports of Kore #1494's newer rounds (founder arenas, a founding's staged space, Kore's C library and stdio, descriptors and mmap for C programs, the link window's free span) and the kore-ffi and kore-c halves they carry. `native/` is not merged by hand. `tools/sync-native.py` re-exports it at Kore `fba0662`, the merge of that branch's head into the targeted relay, over this side's recorded export. The closure is now 27 packages and 401 files. Against that branch's export (Kore `4a56f827`) it differs in kore-rt's `futex.rs` and `thread_controller.rs`, the targeted relay, and in `services/swap/boot.toml`, whose digests come from that branch's reseal (`83861dc9`). `native/Cargo.lock` is that branch's: no exported manifest changed. Both lockfiles resolve with `--locked`. `docs/provenance.md` keeps that branch's account of its two moves at the end of "A cancellation is a wake", and restates "A relayed wake reaches its waiter alone" for the new revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
Kore's reseal over the export at `fba0662` (`09a98a0`, built from `8b617ee`, which pins `9808247`) measures the turns step with the founder's arena, so the controller admits all eight threads the step parks beside `main`. With the targeted relay, every step ran to `exit 42` and no wake reached any of the nine. With the futex and controller of `ft/brave-heisenberg-zgoaux`'s head (`83861dc9`), which count and sweep, 1466 wakes reached them over the 400 turns, and the tour failed that step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Brings in ft/brave-heisenberg-zgoaux up to `cbe7b0a`: its re-exports at Kore #1534's merges of #1494's merge of main, its ioctl round and its platform-functions round, and libkore#32's arguments round. `native/` is not merged by hand. `tools/sync-native.py` re-exports it at Kore `c491a40`, the merge of that branch's head into the targeted relay, over this side's recorded export. The closure is 27 packages and 408 files. Against that branch's export (Kore `7c0be6e8`) only kore-rt's `futex.rs` and `thread_controller.rs`, the relay, differ; every exported service's `boot.toml` and both lockfiles are that branch's. `docs/provenance.md` keeps that branch's account of its export's moves and restates "A relayed wake reaches its waiter alone" for the new revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
|
This PR's own CI had not run yet, because it conflicted with #33's new head. Generated by Claude Code |
Brings in ft/brave-heisenberg-zgoaux up to `b04d05b`: its merge of `alpha`, where libkore#32 landed with its virtual device behind a descriptor, and its re-export at Kore `a07b4eae`, MicroPerceptron/kore#1534's merge of MicroPerceptron/kore#1494's final head. `native/` is not merged by hand. `tools/sync-native.py` re-exports it at Kore `b43bd0a6`, the merge of that branch's Kore head (`4393ed08`) into the targeted relay, over this side's recorded export. The closure is 31 packages and 442 files. Against that branch's export (Kore `a07b4eae`), only kore-rt's `futex.rs` and `thread_controller.rs`, the relay, differ, with swap's and vdev's `boot.toml`: their digests are that branch's reseal over the round (`4393ed08`), which followed its export. `native/Cargo.lock` is that branch's, since no exported manifest changed. Everything outside `native/` merges cleanly but `docs/provenance.md`. It keeps that branch's account of its export's moves, and restates "A relayed wake reaches its waiter alone" for the new revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
Kore's reseal over this export (`c6308c60`, built from `a68fa19`, which pins `5756473`) measured the relay once more, with #1494's virtual-device round merged. `make keytest-tcc-x86` ran as its target runs it. The tour ran every step to `exit 42`, and no wake reached the nine parked threads, over 400 turns and 43 wakes. The account of the earlier A/B now says what the merges since changed. Neither side's `futex.rs` moved, and both sides' controller took the same change, `hand_on`, which acts at founding. The relay is still the only difference between the two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S
Summary
Re-exports Kore's kore-rt with the targeted relay (MicroPerceptron/kore#1540). A futex wake relayed through the thread controller now kicks only the threads its waker found waiting and could not kick, rather than every thread with a doorbell waiter registered. A C program's futex wakes take the controller's relay as before and reach fewer threads: a mutex or condition variable handed between two pthreads leaves the program's other parked threads asleep. No libkore crate changes.
Stacked on #33 (
ft/brave-heisenberg-zgoaux).What changed
native/, re-exported bytools/sync-native.pyat Koreb43bd0a, never edited by hand.b43bd0ais the merge of MicroPerceptron/kore#1534's head (4393ed08) into the relay branch.b04d05b(Korea07b4eae), only kore-rt'sfutex.rsandthread_controller.rsdiffer: the relay.boot.tomldiffer too: their digests are MicroPerceptron/kore#1534's reseal over the virtual-device round, which followed ffi: a cancellation wakes its target, and no cancellable wait polls #33's export.native/Cargo.lockand the root lockfile are ffi: a cancellation wakes its target, and no cancellable wait polls #33's, since no exported manifest changed.docs/runtime.md: the controller kicks only the thread the waker found waiting.docs/provenance.md: "A relayed wake reaches its waiter alone", with the design, why it loses no wake, and the metal evidence.Commits
021ecbenative: re-export at Kore 920526a, where a relayed wake reaches its waiter alonea2561bbMerge the founding wait's re-export into the targeted relay's86aa302docs: the targeted relay's evidence on the merged tree9808247Merge #1494's later rounds' re-export into the targeted relay's94bf557docs: the targeted relay's evidence with all nine threads parked(docs only)e83c143Merge the ioctl and platform rounds' re-export into the targeted relay's5756473Merge the virtual-device round's re-export into the targeted relay's: the revision Kore pins (MicroPerceptron/kore#1540 ata68fa19)c848d40docs: the targeted relay's evidence over the virtual-device round(docs only)Each merge brings in #33's branch as it moved. None merges
native/by hand: each re-exports it at Kore's matching merge.Verification
On
c848d40:make fmt owners bindings-check test check docs cross miri: all pass.testpassed 686 across 31 binaries, among them the exported kore-rt suite (475) with the relay's three.miripassed 102 across 15 binaries.crosschecks x86_64, aarch64 and riscv64gc, andlibkore.soexports the declared ABI exactly on each (133 symbols).host,miri, andtargetsfor x86_64, aarch64 and riscv64gc.On
5756473, the revision Kore pins:python3 tools/sync-native.py <kore> --revision b43bd0a --check: the export matches upstream commitb43bd0a.tools/check-native.py: exact recorded source bytes, no untracked implementation files.CI passes every job.
Kore's kore-rt host suites on the exported tree pass:
test-rt489, the library's 475 among them with the relay's three, andtest-rt-validate496.Kore's metal evidence,
make keytest-tcc-x86run as its target runs it on the image built against5756473(Korea68fa19, sealed inc6308c6). Nine threads stay parked while two take 400 turns through a mutex and a condition variable:exit 42, every stepe83c143(Kore00d666c)exit 4283861dc(count and sweep), the earlier A/BSince that A/B the merges have changed neither side's
futex.rs, and brought the same founding-time change (hand_on) to both sides' controller, so it still compares the same two designs. Kore'srun-boot-gate-x86passes on that sealed tree too: all 20 services founded,shell-startup: PASS.On
e83c143, the previous head:make fmt owners bindings-check test check docs cross miriall pass (test675 across 31 binaries,miri94 across 15).Note
The export lags Kore's reseal by design, as #33's does.
native/is byte-exact at its recorded revisionb43bd0a, the merge, so its six exported services'boot.tomldigests are MicroPerceptron/kore#1534's. Kore's reseal over the pin (c6308c6) moved them afterwards.🤖 Generated with Claude Code
https://claude.ai/code/session_01ACHC7dri3nhVBsSLKqfP8S