Skip to content

feat(format): validated-tensor-v1 + wasmtime-upgrade-v1 + unified-specs-v1 11-gate PARTIAL discharge#1390

Closed
noahgift wants to merge 2 commits into
mainfrom
feat/vt-wasm-specs-001-011-partial-discharge
Closed

feat(format): validated-tensor-v1 + wasmtime-upgrade-v1 + unified-specs-v1 11-gate PARTIAL discharge#1390
noahgift wants to merge 2 commits into
mainfrom
feat/vt-wasm-specs-001-011-partial-discharge

Conversation

@noahgift
Copy link
Copy Markdown
Contributor

@noahgift noahgift commented May 2, 2026

Summary

Bundles three sister contracts in one verdict module:

  • validated-tensor-v1 (FALSIFY-VT-001..004): density, NaN/Inf rejection, zero-row L2, SIMD parity
  • wasmtime-upgrade-v1 (FALSIFY-WASM-001..004): api compat, behavioral parity, advisory clean, gc feature
  • unified-specs-v1 (FALSIFY-SPECS-001..003): TOC ≤ 500 lines, no orphan specs, no subcrate specs

37 unit tests including 8-bucket density sweep + 6-bucket TOC size sweep.
Algorithm-level coverage advances by 11 gates; runtime ship % unchanged.

Gates bound

Gate ID Rule
VT-001 density > 0.055
VT-002 validation result mirrors input contamination (no false neg / pos)
VT-003 at least one row has nonzero L2 norm
VT-004 SIMD validation Err/Ok matches scalar (zero tolerance)
WASM-001 cargo check --features runtime compiles
WASM-002 all runtime tests pass (≥ 1 ran, 0 failed)
WASM-003 zero wasmtime entries in .cargo/audit.toml + deny.toml
WASM-004 gc feature enables wasm_reference_types
SPECS-001 TOC.md ≤ 500 lines AND non-empty
SPECS-002 zero orphan .md files in docs/specifications/
SPECS-003 zero subcrate specs under crates/*/docs/specifications/

Five Whys

See commit message — captures mirror-result rationale for VT-002, fail-on-zero-tests for WASM-002, and fail-on-empty-TOC for SPECS-001.

Test plan

  • cargo test -p aprender-core --lib vt_wasm_specs — 37 passed
  • PMAT pre-commit gates green
  • CI green

🤖 Generated with Claude Code

…cs-v1 11-gate PARTIAL discharge

Bundles three sister contracts in one verdict module:

validated-tensor-v1 (FALSIFY-VT-001..004):
- VT-001: density gate — non-zero fraction > 0.055
- VT-002: NaN/Inf detection (validation-result-mirrors-input invariant)
- VT-003: at least one row has nonzero L2 norm
- VT-004: SIMD vs scalar validation — same Err/Ok decision

wasmtime-upgrade-v1 (FALSIFY-WASM-001..004):
- WASM-001: api_compatibility — `cargo check --features runtime` compiles
- WASM-002: behavioral_parity — all runtime tests pass (≥1 ran, 0 failed)
- WASM-003: advisory_elimination — zero wasmtime entries in audit/deny
- WASM-004: gc feature enables wasm_reference_types

unified-specs-v1 (FALSIFY-SPECS-001..003):
- SPECS-001: TOC.md ≤ 500 lines (and non-empty)
- SPECS-002: zero orphan specs (every .md linked from TOC)
- SPECS-003: zero subcrate specs (root-only)

## Five Whys

1. Why bundle these three contracts? They span the
   validation/runtime/spec coverage band; binding them in one PR
   captures three sister contracts without duplicate provenance pin
   overhead.
2. Why does this block ship? Coverage % cannot move while peripheral
   tensor-validation, wasmtime, and spec-organization gates are
   unbound at PARTIAL_ALGORITHM_LEVEL.
3. Why mirror-result for VT-002 (input-has-NaN ↔ validation-returns-Err)?
   The contract says "scanning misses NaN/Inf" is the failure
   mode. Two-sided check catches both:
   - false negative (NaN present, validation passed) — privacy/UB risk
   - false positive (clean input, validation rejected) — usability bug
4. Why fail-on-zero-tests for WASM-002? The contract says "all
   tests pass." Zero tests run vacuously satisfies that — but means
   the upgrade was never actually exercised. The gate must Fail
   rather than vacuously pass for the regression class "test runner
   broke and skipped everything."
5. Why fail-on-empty-TOC for SPECS-001? Same Fail-on-zero rationale
   as several earlier discharges (cgp-monorepo-build, decode-hp23,
   qdot, tensorlayout). Empty TOC silently passes the ≤500 bound
   but means TOC was deleted. Catching the regression class up-front
   is cheaper than discovering it later.

Adds 37 unit tests including 8-bucket density sweep + 6-bucket TOC
size sweep. Realistic-healthy walks the canonical post-upgrade
state; pre-fix walks 11 simultaneous regressions across all three
contracts (sparse embedding, NaN leak, dead row, SIMD drift, broken
API, failing tests, advisory leak, gc disabled, bloated TOC, orphan
specs, subcrate spec leftovers).

No runtime % shift; algorithm-level coverage advances by 11 gates.
@noahgift noahgift force-pushed the feat/vt-wasm-specs-001-011-partial-discharge branch from c72ebaa to 68c05b9 Compare May 11, 2026 15:27
@noahgift noahgift enabled auto-merge (squash) May 11, 2026 15:27
@noahgift
Copy link
Copy Markdown
Contributor Author

Superseded by #1637 (135-PR squash). The commit content is included verbatim in that PR's diff. Closing now to release runner slots; this PR would have auto-closed when #1637 merges.

@noahgift noahgift closed this May 12, 2026
auto-merge was automatically disabled May 12, 2026 09:21

Pull request was closed

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