Skip to content

feat: expand wit-bindgen fixtures to 8 type families#15

Merged
avrabe merged 2 commits intomainfrom
feat/wit-bindgen-fixtures-expanded
Mar 8, 2026
Merged

feat: expand wit-bindgen fixtures to 8 type families#15
avrabe merged 2 commits intomainfrom
feat/wit-bindgen-fixtures-expanded

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Mar 7, 2026

Summary

Test plan

closes #10

🤖 Generated with Claude Code

avrabe and others added 2 commits March 7, 2026 19:55
… tests

Complete STPA for the meld fusion pipeline:
- 5 losses, 7 hazards (+8 sub-hazards), 9 system constraints
- 30 UCAs across parser/resolver/merger/adapter controllers
- 14 loss scenarios with causal factors
- 20 safety requirements with traceability to STPA artifacts
- JSON Schema for STPA YAML validation

Add 30 unit tests derived from STPA loss scenarios:
- Parser: canonical ABI element size (SR-3, LS-P-2)
- Resolver: CopyLayout classification (SR-6, LS-R-2),
  diamond topo sort (SR-7, LS-R-3), unresolved imports (SR-5)
- Rewriter: all index-bearing instructions (SR-9, LS-M-2)
- Segments: element/data segment reindexing (SR-10)
- Lib: deterministic output (SR-19, LS-CP-2), error paths (SR-20)

Fix non-deterministic topological sort (LS-CP-2): sort adjacency
lists in Kahn's algorithm to ensure stable output across runs.

Fix wit_bindgen_runtime test guards: use per-fixture file checks
instead of directory-only check, preventing false panics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… flavorful

Expand wit-bindgen test coverage from 4 to 8 type families (issue #10):
- variants: variant, enum, option<T>, result<T,E> types
- options: option<string>, nested option<option<u32>>
- many-arguments: 16-parameter function calls (spilling)
- flavorful: mixed types — lists in records/variants, typedefs

All 8 fixtures fuse and validate as both CoreModule and Component.
Runtime execution passes for numbers, strings, lists, records, and
many-arguments. Three runtime tests (variants, options, flavorful)
have known adapter string corruption (issue #14) — handled with
graceful degradation.

Also fix component wrapper to export bare functions (like `run`)
that aren't wrapped in WASI interface instances, and update runtime
test harness to use lower-level wasmtime API for function invocation.

closes #10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avrabe avrabe merged commit f834eb1 into main Mar 8, 2026
1 of 3 checks passed
@avrabe avrabe deleted the feat/wit-bindgen-fixtures-expanded branch March 8, 2026 07:17
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.

Add wit-bindgen fixtures for remaining type families

1 participant