Repository navigation
feat(gust): exec-provider componentizes — WIT-type the taskdisp seam (unblocks gale#224) - #232
Merged
Merged
Conversation
…so gust:os/exec can be fused
exec-provider was the one gust:os provider that could not be shipped as a
component. Its trusted dispatch seam was a raw `(import "env" "poll_task")`,
so `wasm-tools component new` refused it outright:
error: module requires an import interface named `env`
That is a hard blocker for gale#224 (fuse all gust:os providers into one
component): a provider that only exists as a core module cannot enter the
fuse, so the executor — the capability spawn and timer are both backed by —
was excluded from the delivery unit.
Fix the seam, not the executor. gust-os.wit gains an `exec` interface (the
three functions the crate already exported, kebab-cased, with the same lo/hi
u32 split the synth ARM backend forces) and a `world exec-provider { import
taskdisp; export exec; }`. The crate generates against that world and resolves
the executor's `extern "C" poll_task` through a forwarder into the WIT-typed
`gust:os/taskdisp.poll-task` import — exactly the shim spawn-provider already
uses, and the reason spawn componentizes while exec did not.
wasm-tools component new -> ok, 7097 B
wasm-tools component wit -> import gust:os/taskdisp@0.1.0
export gust:os/exec@0.1.0
Nothing outside gust:os/* is imported, which is the invariant
build-gustos-components.sh enforces (still green for time-provider; exec is
not added to PROVIDERS here — that is the gale#224 follow-up).
No scheduling logic moved. The `Guest` impl forwards to the existing
`exec_admit`/`exec_poll_round`/`exec_state` bodies rather than restating the
marshalling, so the component and the natively-dissolved object are the same
three bodies reached two ways; those C-ABI symbols stay exported because
benches/gust/build.rs asserts them and gust_exec_probe links them. The diff
against the executor include is empty.
One consequence is recorded rather than papered over: a regenerated exec-cm3.o
now DEFINES `poll_task` and leaves `poll-task` undefined, so gust_exec_probe's
stub must be renamed when that artifact is rebuilt (gust_os_ts_probe already
made this move). Verified both ways on a scratch dissolve; the checked-in
object predates the change, so `cargo run --bin gust_exec_probe` is green as
committed.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011QG86sovTbfnPNY9SfhSmo
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unblocks gale#224 (the fused OS as one component exporting
gust:os).The blocker
Four of the five
gust:osproviders already componentize cleanly.exec-providerdid not:It carried one raw import,
env.poll_task, and three raw#[no_mangle]exports, and it had no WIT world. Meanwhileinterface taskdisp { poll-task: func(id: u32) -> u32; }already existed and is that import — andspawn-providerandtimer-providerboth importtaskdispwhile nothing exported it. The hole sat at the centre of the composition graph, which is why gale#224 could not close.This is a seam defect, not a design one.
The change
wit-os/gust-os.wit: addinterface exec(admit/poll-round/state) andworld exec-provider { import taskdisp; export exec; }exec-provider: move onto the samewit_bindgen::generate!pattern the other four providers useVerified
No import outside
gust:os/*/gust:hal/*.build-gustos-components.shstill passes for the existing providers;gust_exec_probestill runs green under qemu (both tasks Done, hi-prio first).No semantic drift
The executor's algorithm, data structures and numeric behaviour are untouched. The
lib.rsdiff deletes no code — only three comment lines change. TheGuestimpl forwards to the existingextern "C"bodies rather than restating the marshalling, so the two surfaces cannot diverge, and the#[no_mangle]symbols remain exported becausebuild.rsasserts them and the probe links them.One consequence, documented not worked around
Re-dissolving today's source flips the object's symbol contract:
poll_taskbecomes defined (the forwarder) andpoll-taskbecomes the undefined seam — the same shapeos-ts-cm3.oalready has. Whoever regeneratesexec-cm3.omust rename the probe's stub to#[export_name = "poll-task"], asgust_os_ts_probealready did. Both directions were checked (current stub -> duplicate-symbol link error; renamed stub -> probe green).The checked-in
exec-cm3.owas deliberately not regenerated: that would bump it off the synth 0.42.0 build whose measurements and defect narrativeRESULTS.mddocuments, which deserves its own reviewable change. The tree is green as committed, and the requirement is recorded inRESULTS.mdand at the probe's stub so it cannot be hit silently.Part of the v0.6.0-rc Research Day cut (M1).
🤖 Generated with Claude Code
https://claude.ai/code/session_011QG86sovTbfnPNY9SfhSmo