Registry Mirror
Skip to content

Conversation

@avrabe

@avrabe avrabe commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Medium Bug Fixes (7 issues)

  • M2: B.W branch offset J1/J2 follows ARM T4 encoding spec
  • M3: Binary reset handler implements .data copy + .bss zero loops with MOVW/MOVT
  • M4/M5: ELF entry point and STT_FUNC symbols have Thumb bit set
  • M6: R10 (memory size) initialized in startup code
  • M8: Vector table alignment 256 bytes (was 128, too small for 34 entries)
  • M10: MPU device() preset distinct from strongly_ordered() (bufferable=true)

Cross-Compilation Pipeline Design

  • Design doc: docs/design/cross-compilation-pipeline.md — 3-phase plan from bare-metal through Zephyr to real hardware
  • 12 cross-compilation artifacts (XC-001..009): kiln-builtins stub, Bazel build, linker detection, --link flag, board-specific scripts, 4-level test progression
  • 9 gale integration artifacts (GI-001..005): Zephyr module co-deployment, target triple compat, WASM task isolation via gale primitives, WIT interfaces
  • rivet.yaml: added gale external for cross-repo traceability

Test plan

  • cargo test --workspace — 851 tests, 0 failures
  • cargo clippy — clean
  • cargo fmt --check — clean

🤖 Generated with Claude Code

avrabe and others added 2 commits March 21, 2026 17:28
Medium bug fixes (7 issues from embedded code review):
- M2: B.W branch offset J1/J2 encoding follows ARM T4 spec
- M3: Binary reset handler uses MOVW/MOVT, .data copy + .bss zero loops
- M4: ELF entry point has Thumb bit set for ARM targets
- M5: STT_FUNC symbol values have Thumb bit set
- M6: R10 (memory size) initialized in startup code via MOVW/MOVT
- M8: Vector table alignment increased to 256 bytes (was 128)
- M10: MPU device() preset sets bufferable=true (was identical to strongly_ordered)

Cross-compilation pipeline design:
- docs/design/cross-compilation-pipeline.md — 3-phase plan:
  Phase 1: bare-metal (synth → module.o → ld → firmware.elf → Renode)
  Phase 2: Zephyr (assembly path via west build + gale module)
  Phase 3: hardware (STM32F4-Discovery, nRF52840-DK)
- artifacts/cross-compilation.yaml — 12 artifacts (XC-001..009, XC-TR-001..003)
- artifacts/gale-integration.yaml — 9 artifacts (GI-001..005, GI-TR-001..002, GI-VER-001..002)
- rivet.yaml — added gale as external reference

Implements: FR-005
Fixes: NFR-002
Trace: skip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
252 artifacts across 17 types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe
avrabe merged commit cad2825 into main Mar 21, 2026
6 checks passed
@avrabe
avrabe deleted the feat/medium-fixes-pipeline-plan branch March 21, 2026 17:06
avrabe added a commit that referenced this pull request Jun 14, 2026
…B .data blob) (#347)

A dissolved `--relocatable --native-pointer-abi` object emitted the entire wasm
linear-memory reservation as a SHT_PROGBITS `.data` section (`__synth_wasm_data`)
— 64 KB of mostly-zero bytes — making it unshippable on a 128 KB-RAM MCU (gale
#345; blocks 51 struct-return decide drop-ins + jess PR #60).

Fix (build_relocatable_elf): when the native-pointer linmem carries NO
initialized `(data)` segment (a pure zero-init reservation, e.g. the 64 KB
shadow stack of a pure-arithmetic decide), emit it as a SHT_NOBITS `.bss`
(zero file bytes — the Zephyr loader zeroes .bss, preserving wasm zero-init
semantics) and put the materialized `__synth_globals` slots (non-zero inits) in
their own tiny PROGBITS `.data`. When a `(data)` segment IS present the region
stays one PROGBITS section (the prefix/tail split is deferred to step 2).

Measured on the committed mutex repro (--target cortex-m4f --native-pointer-abi
--relocatable): `.data` 65548 -> 4 bytes; `.bss` 0 -> 65544 (NOBITS, no file
bytes). native_pointer_static (has data segment) keeps PROGBITS .data 264;
native_pointer_bss (zero-init) -> .bss 264 / .data 0; native_pointer_shadow_stack
differential PASS. The four frozen differentials (control_step 0x00210A55,
flight_seam 0x07FDF307, div_const 338/338, mutex_pressure) stay byte-identical
(the split only fires under --native-pointer-abi). Regression test
native_pointer_zero_linmem_lands_in_nobits_bss_345.

STEP 2 (PC-relative instead of the 22 surviving MOVW/MOVT_ABS relocs) is a
separate PR. Refs #345.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
avrabe added a commit that referenced this pull request Jun 14, 2026
… link-survivable relocs) (#349)

Bundles both #345 fix steps: dissolved --relocatable --native-pointer-abi objects
are now MCU-shippable (zero-init linmem -> NOBITS .bss, .data 65548->4 #347) and
link-survivable (inline MOVW/MOVT-ABS -> literal-pool R_ARM_ABS32, 22->0 inline
abs relocs #348). Unblocks the 51 struct-return decide drop-ins + jess PR #60.
Frozen differentials byte-identical (change gated on --native-pointer-abi).

Pin sweep 0.11.42 -> 0.11.43 (11 manifests + MODULE.bazel + Cargo.lock).
Falsification statement in the changelog. Closes #345 (gale silicon link-test
is the final gate).

Co-authored-by: Claude Opus 4.8 <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