Skip to content

safety: initial STPA analysis#40

Open
avrabe wants to merge 1 commit intomainfrom
safety/stpa-initial
Open

safety: initial STPA analysis#40
avrabe wants to merge 1 commit intomainfrom
safety/stpa-initial

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 10, 2026

Summary

  • Adds STPA (System-Theoretic Process Analysis) for Synth as a WebAssembly-to-ARM AOT compiler
  • 6 losses, 10 hazards (3 sub-hazards)
  • Follows the same schema as Meld's STPA (pulseengine/meld/safety/schema/stpa.schema.json)

Key coverage areas:

  • Instruction selection correctness
  • Peephole optimization safety
  • Bounds check generation
  • ARM encoding validity (ISA variant matching)
  • Control flow translation (block/loop/if → labels/branches)
  • Register allocation correctness
  • ELF generation (vector table, relocations, sections)
  • Meld dispatch ABI compatibility (__meld_dispatch_import)
  • Verification gap (52 Admitted Rocq proofs, Z3 spec vs implementation)
  • Cross-toolchain canonical ABI consistency with Meld and Kiln (H-10)

Context

Motivated by BA RFC #46 analysis. Synth provides an alternative execution path (AOT) to the RFC's runtime-based approach. The STPA identifies hazards specific to the compilation path that the RFC doesn't cover.

Cross-toolchain consistency analysis in pulseengine/meld at safety/stpa/cross-toolchain-consistency.yaml.

Next steps

  • Add control structure and controlled processes (Step 2)
  • Add UCAs (Step 3)
  • Add loss scenarios (Step 4)
  • Add safety requirements
  • Connect to existing Rocq proof coverage

🤖 Generated with Claude Code

Adds system-theoretic process analysis for Synth as a WebAssembly-to-ARM
AOT compiler. Covers 6 losses and 10 hazards (with 3 sub-hazards).

Key areas: instruction selection correctness, bounds check generation,
ARM encoding validity, control flow translation, register allocation,
ELF generation, Meld dispatch ABI compatibility, and verification gap
between proofs and implementation.

Follows the same STPA schema as Meld (pulseengine/meld/safety/schema/stpa.schema.json).

Co-Authored-By: Claude Opus 4.6 <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