feat(format): kernel-launch-budget-v1 + ica-v1 7-gate PARTIAL discharge#1402
Open
feat(format): kernel-launch-budget-v1 + ica-v1 7-gate PARTIAL discharge#1402
Conversation
Bundles two sister contracts in one verdict module:
kernel-launch-budget-v1 (FALSIFY-KL-001..004):
- KL-001: per-token launches == 12 * num_layers + final_kernels
- KL-002: per-layer kernel decomposition sums to exactly 12
- KL-003: launches strictly monotone in num_layers
- KL-004: SIMD vs scalar budget calculation bit-equal
ica-v1 (FALSIFY-ICA-001..003):
- ICA-001: transformed shape == (n_samples, n_components)
- ICA-002: transform(X) bit-deterministic across calls
- ICA-003: every output finite for finite input
## Five Whys
1. Why bundle these two contracts? Both peripheral, span the
GPU-launch-counting + ICA decomposition coverage band; one
verdict module captures both without provenance pin overhead.
2. Why does this block ship? Coverage % cannot move while these
peripheral contracts are unbound at PARTIAL_ALGORITHM_LEVEL.
3. Why pin `AC_KL_PER_LAYER_KERNELS = 12` as a const? The
contract specifies "Component sum = 12" as a static assertion.
A future refactor that fuses two kernels into one (sum=11) or
adds an extra kernel (sum=13) must trip the gate at PR time
— not silently change the launch budget downstream.
4. Why bit-exact (`to_bits()`) for ICA-002? The contract says
"Transform deterministic" — ICA's whitening + projection is
a fixed matrix multiply once fitted. Any drift between two
`transform(X)` calls indicates a random-state leak (e.g., a
stale RNG getting consumed for tie-breaking). Float-tolerant
compare would mask that exact regression class.
5. Why a 5×5 monotonicity sweep for KL-003 (instead of just one
pair)? The contract is "more layers → more launches" across
the entire layer-count domain. Sweeping all (la, lb) pairs in
{0, 1, 12, 24, 50} catches degenerate cases (la=0, la=lb,
la>lb, la<lb) that a single point would miss.
Adds 28 unit tests including a 5×5 monotonicity sweep and 4-bucket
decomposition cases. Realistic-healthy walks the canonical 24-layer
Qwen + ICA fit; pre-fix walks 7 simultaneous regressions.
No runtime % shift; algorithm-level coverage advances by 7 gates.
170db99 to
db23b5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles two sister contracts:
kernel-launch-budget-v1(FALSIFY-KL-001..004): per-token formula, 12-kernel decomposition, monotonicity, SIMD≡scalarica-v1(FALSIFY-ICA-001..003): output shape, deterministic, finite28 unit tests including 5×5 monotonicity sweep + 4-bucket decomposition cases.
Algorithm-level coverage advances by 7 gates; runtime ship % unchanged.
Gates bound
12 * num_layers + final_kernelsla < lb → launches_a < launches_b(n_samples, n_components)transform(X)bit-deterministicFive Whys
See commit message — captures pinned
12constant, bit-exact for ICA-002, and 5×5 monotonicity sweep rationale.Test plan
cargo test -p aprender-core --lib kl_ica— 28 passed🤖 Generated with Claude Code