Skip to content

fix(build): de-conflate std from bazel-bindings; select artifacts by name; register components - #324

Merged
avrabe merged 2 commits into
mainfrom
fix/deconflate-nostd-feature
Jul 30, 2026
Merged

fix(build): de-conflate std from bazel-bindings; select artifacts by name; register components#324
avrabe merged 2 commits into
mainfrom
fix/deconflate-nostd-feature

Conversation

@avrabe

@avrabe avrabe commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the core-module incident, answering "why isn't this in the Bazel rules?". The investigation found the script and Bazel don't just duplicate each other — they diverge.

1. Feature de-conflation (the real design flaw — mine)

bazel-bindings means "where do the WIT bindings come from" in every stage crate. In rate I gave it a second meaning — std vs no_std — so one source produced materially different artifacts per build system. Now split into an independent std feature.

⚠️ Corrected claim: I originally wrote that this would make Bazel emit the WASI-free component. It does not. CI proved it: flipping the semantics did move Bazel onto the no_std path, which immediately exposed that the target can't support it —

error[E0433]: cannot find module or crate `lol_alloc`
error[E0152]: found duplicate lang item `panic_impl`

Bazel doesn't read Cargo.toml deps, and rules_rust still links std. So Bazel now explicitly opts into std, and behaviour is unchanged from before this PR. What's gained is that the two concerns no longer ride one flag, and the remaining gap is named rather than hidden.

2. Artifact selection by name (second latent bug)

Found while verifying the above: ls target/.../*.wasm | head -1 picks whatever sorts first. With a shared CARGO_TARGET_DIR — a common CI disk-saving setting — building rate selected falcon_flight_component.wasm ("flight" < "rate") and would have published it under the wrong name. Now derives the artifact from the crate name and honours CARGO_TARGET_DIR.

3. wasm.directory registration

Filed the four verified components — iekf, position, attitude, mixer (issues #474–#477 → auto-PRs #478–#481; existing namespace auto-merges).

falcon-rate deliberately HELD: the published 1.129.0 artifact is still a core module. Registering a broken artifact in a public index is worse than a late listing. Documented with the header-check recipe, since config.mediaType claims "component" regardless of payload.

The real follow-up (documented, not done here)

Make Bazel able to build the no_std variant (lol_alloc in crate_universe + a genuine no_std config), then have the release consume Bazel outputs and reduce the script to a thin bundler. That structurally removes the bug class that shipped falcon-rate:1.129.0 — a Bazel action failure can't be swallowed, and its outputs are declared rather than globbed.

Refs: jess#167, #323.

🤖 Generated with Claude Code

avrabe and others added 2 commits July 29, 2026 20:31
…name; register components

Follow-up to the core-module incident, addressing "why isn't this in the bazel
rules" — the investigation found the script and bazel are not just duplicated,
they DIVERGE.

1. FEATURE DE-CONFLATION (the real design flaw, mine). `bazel-bindings` means
   "where do the WIT bindings come from" in every stage crate. In rate I gave it
   a SECOND meaning — std vs no_std — so the two build systems produced
   materially different artifacts from one source: bazel (sets bazel-bindings)
   got std + WASI imports; cargo-component (--no-default-features) got the
   WASI-free one we publish. Split into an independent `std` feature. Because
   rules_rust does not apply Cargo's default-features, a bazel build enabling
   only `bazel-bindings` now gets no_std — i.e. bazel produces the WASI-free
   component too. Verified the cargo path is unchanged: component header,
   4581 bytes, ZERO wasi imports.

2. ARTIFACT SELECTION BY NAME (second latent bug, found while verifying the
   above). `ls target/.../*.wasm | head -1` picks whatever sorts first — with a
   shared CARGO_TARGET_DIR (a common CI disk-saving setting) building `rate`
   selected falcon_flight_component.wasm because "flight" < "rate", and would
   have published it under the wrong name. Now derives the expected artifact
   from the crate name and honours CARGO_TARGET_DIR.

3. wasm.directory REGISTRATION. Filed the four verified components (iekf,
   position, attitude, mixer -> issues #474-#477, auto-PRs #478-#481; adding to
   an existing namespace auto-merges). falcon-rate is deliberately HELD: the
   published 1.129.0 artifact is still the core module, and registering a broken
   artifact in a public index is worse than a late listing. Documented, with the
   header-check recipe — config.mediaType claims "component" regardless of the
   bytes, so metadata cannot be trusted for this.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
…lation, honestly scoped)

CI caught that my feature de-conflation was correct in principle but incomplete.
Flipping the semantics DID move the bazel build onto the no_std path — and that
immediately exposed that the bazel target cannot support no_std yet:

    error[E0433]: cannot find module or crate `lol_alloc`
    error[E0152]: found duplicate lang item `panic_impl`

Bazel does not read Cargo.toml deps (lol_alloc is absent from the target's
deps), and rules_rust still links std, so the crate's own #[panic_handler]
collides. Making bazel emit the WASI-free variant is therefore real work — a
crate_universe entry plus a genuine no_std config — not a feature flip.

So: keep the de-conflation (it is a genuine improvement and the prerequisite for
convergence) and have the bazel target opt into `std` EXPLICITLY. Behaviour is
unchanged from before this PR — bazel builds the std variant, cargo-component
builds the WASI-free one we publish — but the two concerns are no longer riding
one flag, and the remaining gap is named rather than hidden.

Documented the divergence and the follow-up in docs/OCI-DISTRIBUTION.md: once
bazel can build no_std, the release should consume bazel outputs and the script
becomes a thin bundler — which structurally removes the bug class that shipped
falcon-rate:1.129.0 as a core module.

Corrects my own PR claim: I said this would make bazel produce the WASI-free
component. It does not, and I am not asserting it until measured.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
@avrabe
avrabe merged commit 109fd8e into main Jul 30, 2026
13 checks passed
@avrabe
avrabe deleted the fix/deconflate-nostd-feature branch July 30, 2026 03:45
avrabe added a commit that referenced this pull request Jul 30, 2026
#325)

FV-FALCON-OCI-001 claimed distribution was "validated end-to-end" on v1.127/
v1.128. That evidence was NOT sufficient, and jess proved it in the field:
falcon-rate:1.129.0 shipped as a raw core module. My check confirmed the OCI
config mediaType — which reads "component" regardless of the payload — so it
verified the WRAPPER, not the BYTES.

Record it honestly rather than quietly re-verifying: the gap, its root cause
(no_std dropped `cabi_realloc`, wit-bindgen-rt only provides it when std is
linked; the build failure was then swallowed by `|| true`), and the four
strengthenings that close it (#323, #324) — cabi_realloc exported, build
failures abort, an 8-byte HEADER assert on every component (verified to REJECT
the published 1.129.0 artifact), and by-name artifact selection.

This is the release-planning loop working as intended: a field regression
re-opens the requirement's verification rather than being patched silently.

Also defers SWREQ-FALCON-MATHF32-P06 (Cody-Waite argument reduction) from
v1.130 to v1.131 — an explicit, logged scope move, not a silent slip. It is the
multi-week proof of the four and is not ready; v1.130 is a fix release that
republishes falcon-rate as a real component.

rivet validate: PASS.


Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG

Co-authored-by: Claude Fable 5 <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