Skip to content

feat(format): linear-probe-classifier-v1 + model-family-parity-v1 9-gate PARTIAL discharge#1382

Closed
noahgift wants to merge 2 commits into
mainfrom
feat/probe-parity-001-009-partial-discharge
Closed

feat(format): linear-probe-classifier-v1 + model-family-parity-v1 9-gate PARTIAL discharge#1382
noahgift wants to merge 2 commits into
mainfrom
feat/probe-parity-001-009-partial-discharge

Conversation

@noahgift
Copy link
Copy Markdown
Contributor

@noahgift noahgift commented May 2, 2026

Summary

Bundles two sister contracts in one verdict module:

  • linear-probe-classifier-v1 (FALSIFY-PROBE-001..004): encoder frozen, softmax valid, K*d+K param count, embedding determinism
  • model-family-parity-v1 (FALSIFY-PARITY-001..005): enum↔YAML symmetry, round-trip, display_name nonempty, is_llm classification

28 unit tests including 11-bucket softmax sweep + 4-shape param formula sweep.
Algorithm-level coverage advances by 9 gates; runtime ship % unchanged.

Gates bound

Gate ID Rule
PROBE-001 Encoder bytes equal before/after 100 training steps
PROBE-002 Softmax sums to 1 within 1e-6 AND every prob > 0
PROBE-003 trainable_params == K * d_model + K
PROBE-004 Embedding bit-deterministic across calls (ULP-strict)
PARITY-001+002 Enum variants set == YAML families set (HashSet equality)
PARITY-003 from_model_type(str) round-trips for every variant
PARITY-004 display_name() is non-empty for all variants
PARITY-005 is_llm() classification matches contract

Five Whys

See commit message — captures HashSet vs sorted-vec, 3-tuple vs pair for round-trip, and strict > 0.0 for softmax saturation.

Test plan

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

🤖 Generated with Claude Code

…ate PARTIAL discharge

Bundles two sister contracts in one verdict module:

linear-probe-classifier-v1 (FALSIFY-PROBE-001..004):
- PROBE-001: encoder weights byte-equal before/after 100 training steps
- PROBE-002: softmax sums to 1 within 1e-6 AND every value > 0
- PROBE-003: trainable_params == K * d_model + K (overflow-safe)
- PROBE-004: embedding bit-determinism across calls (ULP-strict)

model-family-parity-v1 (FALSIFY-PARITY-001..005):
- PARITY-001 + 002: enum and YAML registry sets are equal
- PARITY-003: from_model_type round-trips for every (str, variant)
- PARITY-004: display_name() is non-empty for all variants
- PARITY-005: is_llm() classification matches contract per variant

## Five Whys

1. Why bundle these two contracts? Both are 4 + 5 gate sister
   contracts in the model-architecture / family-registry coverage band.
   One verdict module captures both without provenance pin overhead.
2. Why does this block ship? Coverage % cannot move while peripheral
   probe-classifier and model-family-registry contracts are unbound at
   PARTIAL_ALGORITHM_LEVEL.
3. Why a 3-tuple `(model_type, expected, actual)` for PARITY-003 vs a
   simple `(actual, expected)` pair? The contract is testing the
   round-trip dispatch, not just an equality check; including
   `model_type_str` makes the test assertion debuggable when a
   future YAML rename breaks the dispatch.
4. Why HashSet equality for PARITY-001+002 vs sorted-vec? Family
   names are unordered identifiers; sorted-vec equality would impose
   a declaration-order constraint the YAML doesn't actually require.
5. Why a strict `> 0.0` for PROBE-002 not `>= 0.0`? Sigmoid /
   softmax saturation produces exactly 0.0 — `>= 0.0` would let the
   regression class pass. Strict `> 0.0` catches numerical underflow
   exactly as the contract intends.

Adds 28 unit tests including 11-bucket softmax band sweep on
PROBE-002 and 4-shape param-formula sweep on PROBE-003.
Realistic-healthy walks a complete 9-gate Pass; pre-fix walks 9
simultaneous regressions (gradient leak, sigmoid underflow, extra
params, embedding ULP drift, orphan registry, dispatch dropout,
empty display name, audio-as-LLM, LLM-as-non-LLM).

No runtime % shift; algorithm-level coverage advances by 9 gates.
@noahgift noahgift force-pushed the feat/probe-parity-001-009-partial-discharge branch from cabda0e to 8440233 Compare May 11, 2026 15:35
@noahgift noahgift enabled auto-merge (squash) May 11, 2026 15:35
@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