Skip to content

feature: WIT-type the inter-core contract — NavState (16×f32) + ActuatorCmd (4×f32) records (REQ-PIX-007) - #164

Merged
avrabe merged 1 commit into
mainfrom
feature/navstate-wit-typed
Jul 23, 2026
Merged

feature: WIT-type the inter-core contract — NavState (16×f32) + ActuatorCmd (4×f32) records (REQ-PIX-007)#164
avrabe merged 1 commit into
mainfrom
feature/navstate-wit-typed

Conversation

@avrabe

@avrabe avrabe commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What

Closes REQ-PIX-007's WIT-typed-contract half. The byte-exact NavState crossing was proven last tick (TEST-PIX-030); this adds the typed record so the inter-core ABI reflects the real 64 B payload, not opaque list<u8>.

The spar#345 resolution (honest correction)

The spar maintainer answered spar#345 and split it cleanly:

  • The data-implementation record path already works on the CI-pinned spar v0.24.0 (REQ-CODEGEN-WIT-RECORDS-001). My last-tick "spar emits list<u8> for all data" was a modeling error — I bound the port to the bare type (out data port VehicleState) while the subcomponents lived on the implementation (VehicleState.nav).
  • The separate Data_Representation=>Array gap was real and the maintainer fixed it upstream (spar PR#346 → list<f32, 16>); jess doesn't need it — the record path is cleaner.

The feature (architecture → spar → WIT)

  • hardware/pixhawk6x-rt.aadl: a local data F32 (Data_Size => 4 Bytes, Data_Representation => Float), VehicleState.nav (16 f32 IEKF fields), ActuatorCmd.pwm (4 f32 per-motor); the 4 inter-core ports bound to the implementations.
  • wit/ regenerated via spar v0.24.0 → record vehicle-state-nav { qw..baz: f32 } + record actuator-cmd-pwm { m0..m3: f32 }. The TEST-PIX-023 WIT-derivation gate passes (committed wit/ == spar codegen).
  • AFD-036 → resolved; TEST-PIX-030 note updated (REQ-PIX-007 now has both crossing + typed contract).

Verification

  • rivet validate → PASS
  • spar parse + instance → OK
  • WIT-derivation gate (regen.sh --check, spar v0.24.0) → OK

Release-watch (same tick)

kiln v0.4.4 (resource_limits, SR-45) + spar v0.31.0 — neither jess-critical; falcon still v1.127 / 14 skips (AFD-035); no inbound.

🤖 Generated with Claude Code

…torCmd (4xf32) records (REQ-PIX-007 typed-contract half; AFD-036 resolved)

Closes REQ-PIX-007's WIT-TYPED-CONTRACT half (the byte-exact crossing was proven in
TEST-PIX-030 last tick; this adds the typed record). The spar maintainer answered
spar#345 and split it honestly: the data-IMPLEMENTATION record path already works on
the CI-pinned spar v0.24.0 — my last-tick "spar emits list<u8> for all data" was a
MODELING ERROR (I bound the port to the BARE type, not the implementation).

Fix (feature-loop: architecture -> spar -> WIT):
- hardware/pixhawk6x-rt.aadl: add a local `data F32` (Data_Size 4 Bytes, Float),
  VehicleState.nav (16 f32 IEKF fields: quat/pos/vel/gyro-bias/accel-bias) +
  ActuatorCmd.pwm (4 f32 per-motor); bind the 4 inter-core ports to the IMPLEMENTATIONS.
- wit/ regenerated via spar v0.24.0 (the CI pin): falcon/estimator/failsafe.wit now carry
  `record vehicle-state-nav {qw..baz: f32}` + `record actuator-cmd-pwm {m0..m3: f32}`
  instead of opaque list<u8>. The TEST-PIX-023 WIT-derivation gate passes (committed wit/
  == spar codegen).
- AFD-036 -> resolved (records were always available — my modeling error; the separate
  Data_Representation=>Array gap was fixed upstream in spar PR#346, not needed here).
- TEST-PIX-030 note: WIT-typing DONE; REQ-PIX-007 now has both crossing + typed contract.

Verified: rivet validate PASS; spar parse + instance OK; WIT-derivation gate OK.

RELEASE-WATCH (same tick): kiln v0.4.4 (resource_limits, SR-45) + spar v0.31.0 - neither
jess-critical; falcon still v1.127 / 14 skips (AFD-035); no inbound.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@avrabe
avrabe merged commit 889af5b into main Jul 23, 2026
5 checks passed
@avrabe
avrabe deleted the feature/navstate-wit-typed branch July 23, 2026 11:03
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