Skip to content

native: re-export kore-rt where a relayed wake reaches its waiter alone - #35

Open
SnowCheetos wants to merge 8 commits into
ft/brave-heisenberg-zgoauxfrom
ft/admiring-lovelace-69eiok
Open

SnowCheetos wants to merge 8 commits into
ft/brave-heisenberg-zgoauxfrom
ft/admiring-lovelace-69eiok

Conversation

@SnowCheetos

@SnowCheetos SnowCheetos commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Commits

  • 021ecbe native: re-export at Kore 920526a, where a relayed wake reaches its waiter alone
  • a2561bb Merge the founding wait's re-export into the targeted relay's
  • 86aa302 docs: the targeted relay's evidence on the merged tree
  • 9808247 Merge #1494's later rounds' re-export into the targeted relay's
  • 94bf557 docs: the targeted relay's evidence with all nine threads parked (docs only)
  • e83c143 Merge the ioctl and platform rounds' re-export into the targeted relay's
  • 5756473 Merge the virtual-device round's re-export into the targeted relay's: the revision Kore pins (MicroPerceptron/kore#1540 at a68fa19)
  • c848d40 docs: 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. test passed 686 across 31 binaries, among them the exported kore-rt suite (475) with the relay's three. miri passed 102 across 15 binaries. cross checks x86_64, aarch64 and riscv64gc, and libkore.so exports the declared ABI exactly on each (133 symbols).
  • CI passes every job: host, miri, and targets for x86_64, aarch64 and riscv64gc.

On 5756473, the revision Kore pins:

  • python3 tools/sync-native.py <kore> --revision b43bd0a --check: the export matches upstream commit b43bd0a. 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-rt 489, the library's 475 among them with the relay's three, and test-rt-validate 496.

  • Kore's metal evidence, make keytest-tcc-x86 run as its target runs it on the image built against 5756473 (Kore a68fa19, sealed in c6308c6). Nine threads stay parked while two take 400 turns through a mutex and a condition variable:

    kore-rt futex and controller wakes that reached a parked thread tour
    this export (targeted relay) 0 (of 43 wakes) exit 42, every step
    the previous export, e83c143 (Kore 00d666c) 0 (of 148 wakes) exit 42
    MicroPerceptron/kore#1534's head 83861dc (count and sweep), the earlier A/B 1466 turns step failed

    Since 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's run-boot-gate-x86 passes 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 miri all pass (test 675 across 31 binaries, miri 94 across 15).

Note

The export lags Kore's reseal by design, as #33's does. native/ is byte-exact at its recorded revision b43bd0a, the merge, so its six exported services' boot.toml digests 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

…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
@SnowCheetos
SnowCheetos added this pull request to stack #36 November 16, 2026 18:40
@SnowCheetos
SnowCheetos marked this pull request as ready for review November 16, 2026 18:40
Copilot AI balanced review requested due to automatic review settings November 16, 2026 18:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

copilot-pull-request-reviewer failed in the review agent's own sandbox, not on this PR's code. Its log ends with Copilot's firewall notice ("Add the appropriate URLs or hosts to my firewall allow list", https://gh.io/copilot/firewall-config), and then the job exits 1. Allowing the blocked host in the repository's Copilot firewall settings is what would clear it.

This PR's own CI had not run yet, because it conflicted with #33's new head. e83c143 resolves that: it merges #33 (cbe7b0a) and re-exports native/ with tools/sync-native.py at Kore c491a40, MicroPerceptron/kore#1540's merge of MicroPerceptron/kore#1534's new head. Against #33's export only kore-rt's futex.rs and thread_controller.rs differ, and both lockfiles are #33's.


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
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.

3 participants