Skip to content

Make architecture tests cross-target contracts - #338

Merged
LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/riscv64-cross-tests
Aug 14, 2026
Merged

Make architecture tests cross-target contracts#338
LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/riscv64-cross-tests

Conversation

@LunaStev

Copy link
Copy Markdown
Member

Summary

  • separate native execution from cross-target compilation with an explicit runner=compile test contract
  • convert previously dormant RISC-V host-gated fixtures into RV64 ELF and assembly artifact checks runnable on every CI host
  • validate generated ELF class, machine, and RISC-V floating-point ABI flags, plus assembly instruction tokens
  • reject malformed or contradictory test metadata instead of silently ignoring it
  • add permanent negative regression tests and run them in every Rust and release workflow architecture job

Why

The RISC-V fixtures were gated on a native RISC-V host, so most CI jobs skipped them even though Wave can cross-compile those sources. Host selection and compiler target selection are different contracts: runtime tests require a compatible host, while object and assembly checks only require the compiler to produce the requested target artifact.

This change makes that distinction explicit and verifies the generated artifact itself. It does not introduce QEMU runtime execution or linker testing; those remain follow-up work for the RISC-V Linux linking phase.

Validation

  • python3 -m py_compile x.py tools/run_tests.py tools/test_contracts.py tools/test_test_contracts.py
  • python3 -m unittest discover -s tools -p 'test_*.py' — 6 tests passed
  • strict metadata scan — 108 Wave fixtures passed
  • focused runner — 7 cross/build fixtures passed with no skips or failures
  • workflow YAML parsing — Rust and release workflows passed
  • git diff --check

Separate compile-only target validation from native test execution by adding an explicit runner=compile metadata contract. This lets architecture fixtures validate generated artifacts on any CI host instead of being skipped when the host architecture differs from the compiler target.

Add strict metadata parsing that rejects malformed, duplicate, unknown, empty, or incompatible fields. Validate build/runner coupling, host-independent compile contracts, artifact emit requirements, successful compile expectations, and RISC-V ABI architecture binding before invoking the compiler.

Inspect generated ELF objects for class, machine, and RISC-V floating-point ABI flags, and inspect assembly using instruction-token matching that excludes comments, directives, and labels. Convert dormant RISC-V syscall fixtures to RV64 object and assembly contracts and make existing build-only fixtures explicit.

Add permanent negative regression tests for invalid metadata, wrong ELF machine/class/ABI, and misleading assembly text. Run these tests together with Python syntax validation in every Rust and release CI architecture job.
@LunaStev
LunaStev marked this pull request as ready for review August 14, 2026 09:32
@LunaStev
LunaStev merged commit 403c396 into wavefnd:master Aug 14, 2026
4 of 6 checks passed
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