The neural notebook
← All chapters

IV-65 / Part XV · Modern LLM Architectures

Evaluating LLMs, Leakage and Reliability

Score six disclosed arithmetic candidates, separate forecast error from decisions, and inspect contamination, calibration and deletion sensitivity without claiming real-world reliability.

Review the ideas this chapter uses

Suppose someone supplies six answers to simple addition questions, together with a probability that each answer is correct. We can check every answer ourselves. That makes a useful starting point for asking what an evaluation score means, how access to the answer key can inflate it, and what remains unknown even when the arithmetic is transparent.

Learning objective: Examine evaluation design, leakage, calibration and uncertainty. Start with IV-58 — Alignment, Safety and Evaluation Limits for the difference between an evaluation proxy and observed behavior. III-35 — Cross-Validation and Hyperparameter Tuning explains why selecting a rule after seeing test results spends test information; III-39 — Reproducibility and Numerical Reliability explains why a reproducible procedure also needs declared arithmetic and data.

The lab scores these supplied answers under one rule: a candidate must equal the exact integer answer. A label of 1 means it meets that rule; a forecast is an authored probability of that label. Start by changing one forecast, then inspect why the probability score and the threshold decision can change differently.

Compute it yourself

Score six disclosed forecasts, then inspect the clean evidence

Six supplied arithmetic answers already have known rubric labels. Edit a forecast or the decision cutoff, then compare probability error with decision accuracy. The starting example has accuracy1/2 and exact-real Brier7/24; the current saved values below use the actual rounded calculation.

All nine controls are native number inputs in capture order p0..p5,tau,m,blend. Forecasts, tau and blend accept continuous finite values from 0 to 1, including -0. Only m requires a whole number 0..6. Original IDs below m are declared exposed; blend deliberately uses their answer keys. This is an authored contamination example, not training, a memorization detector or a real LLM benchmark.

Try m4 then blend1 to see the full score improve by construction while clean IDs4,5 keep their own forecasts. Try m5 for one clean item or m6 for no clean evidence. A missing metric has a saved reason, not a replacement zero. Invalid drafts withhold results and grading; repair the draft or Reset example. Editing, resetting and selecting a trace step clear answers. Opening a disclosure preserves them.

fullAccuracy0.5
fullBrier0.2916666666666667
cleanAccuracy0.5
cleanBrier0.2916666666666667
Exact starting inputs for this saved calculation

fullAccuracy 0.5. fullBrier 0.2916666666666667. cleanAccuracy 0.5. cleanBrier 0.2916666666666667. Set up six disclosed rubric forecasts. Capture the complete validated state before scoring. These are hand-set forecasts about fixed arithmetic candidates, not generated answers, measured model behavior or a random test sample.

Set up six disclosed rubric forecasts

raw=[p0,p1,p2,p3,p4,p5,tau,m,blend]; items=6; bins=2

Capture the complete validated state before scoring. These are hand-set forecasts about fixed arithmetic candidates, not generated answers, measured model behavior or a random test sample.

Saved inputs

p0
0.75
p1
0.25
p2
0.75
p3
0.25
p4
0.5
p5
0.5
tau
0.5
m
0
blend
0

Saved outputs

p0
0.75
p1
0.25
p2
0.75
p3
0.25
p4
0.5
p5
0.5
tau
0.5
m
0
blend
0
itemCount
6
rawInputCount
9
binCount
2

Current whole evaluation. FULL original IDs [0, 1, 2, 3, 4, 5]. fullAccuracy=0.5; fullBrier=0.2916666666666667; fullCount=6; fullCorrect=3; fullTP=2; fullFN=1; fullFP=2; fullTN=1; fullPredictedPositive=4; fullActualPositive=3; fullSSE=1.75; fullMaxAbsoluteResidual=0.75; fullSquareUnderflowCount=0; fullContributionUnderflowCount=0; fullPrecision=0.5; fullRecall=0.6666666666666666; fullCalibrationGap=0.16666666666666666; fullMaxAbsoluteBinGap=0.25; fullAccuracyMin=0.4; fullAccuracyMax=0.6; fullBrierMin=0.2375; fullBrierMax=0.3375; fullAccuracyMinId=0; fullAccuracyMaxId=2; fullBrierMinId=2; fullBrierMaxId=0. fullMembershipAvailability: Defined: retained original IDs in ascending order. fullAccuracyAvailability: Defined: correct/n with n>0. fullBrierAvailability: Defined: SSE/n with n>0. fullPrecisionAvailability: Defined: TP/(TP+FP) with predictedPositive>0. fullRecallAvailability: Defined: TP/(TP+FN) with actualPositive>0. fullBin0Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. fullBin1Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. fullCalibrationAvailability: Defined: separately rounded occupied-bin weight/product/fold. fullLooAvailability: Defined: n>=2; fresh folds for every omission and strict first-ID endpoint selection. CLEAN original IDs [0, 1, 2, 3, 4, 5]. cleanAccuracy=0.5; cleanBrier=0.2916666666666667; cleanCount=6; cleanCorrect=3; cleanTP=2; cleanFN=1; cleanFP=2; cleanTN=1; cleanPredictedPositive=4; cleanActualPositive=3; cleanSSE=1.75; cleanMaxAbsoluteResidual=0.75; cleanSquareUnderflowCount=0; cleanContributionUnderflowCount=0; cleanPrecision=0.5; cleanRecall=0.6666666666666666; cleanCalibrationGap=0.16666666666666666; cleanMaxAbsoluteBinGap=0.25; cleanAccuracyMin=0.4; cleanAccuracyMax=0.6; cleanBrierMin=0.2375; cleanBrierMax=0.3375; cleanAccuracyMinId=0; cleanAccuracyMaxId=2; cleanBrierMinId=2; cleanBrierMaxId=0. cleanMembershipAvailability: Defined: retained original IDs in ascending order. cleanAccuracyAvailability: Defined: correct/n with n>0. cleanBrierAvailability: Defined: SSE/n with n>0. cleanPrecisionAvailability: Defined: TP/(TP+FP) with predictedPositive>0. cleanRecallAvailability: Defined: TP/(TP+FN) with actualPositive>0. cleanBin0Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. cleanBin1Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. cleanCalibrationAvailability: Defined: separately rounded occupied-bin weight/product/fold. cleanLooAvailability: Defined: n>=2; fresh folds for every omission and strict first-ID endpoint selection. Selected saved step setup. Set up six disclosed rubric forecasts. Equation: raw=[p0,p1,p2,p3,p4,p5,tau,m,blend]; items=6; bins=2. Capture the complete validated state before scoring. These are hand-set forecasts about fixed arithmetic candidates, not generated answers, measured model behavior or a random test sample. Inputs: p0=0.75; p1=0.25; p2=0.75; p3=0.25; p4=0.5; p5=0.5; tau=0.5; m=0; blend=0. Outputs: p0=0.75; p1=0.25; p2=0.75; p3=0.25; p4=0.5; p5=0.5; tau=0.5; m=0; blend=0; itemCount=6; rawInputCount=9; binCount=2.

Six supplied answers, one disclosed rule

For every item, the supplied candidate must equal the exact correct integer for the disclosed addition.

A forecast is an authored probability that the supplied candidate meets that rule. Label1 means it does; label0 means it does not. Decision1 means the effective forecast is at least tau. The original IDs below never change when a cohort shrinks.

Every actual prompt, supplied candidate, answer, label and current saved forecast
Original IDPromptCandidateCorrect answerLabel yBase forecastEffective forecastExposed (1=yes)PredictionCorrect (1=yes)
02+24410.750.75011
12+36500.250.25001
23+37600.750.75010
33+47710.250.25000
44+48810.50.5011
54+510900.50.5010

Six self-authored arithmetic prompt/candidate/rubric items and hand-set class1 forecasts. No generated answer, model call, training, IID sample, real overlap detector or measured benchmark. Cleaning changes cohort membership, not a causal estimate of contamination.

All row errors and every executed exposure stage

For exposed IDs only: subtract labelOperand−baseP, multiply blend×delta, then add baseP+taint, with separate rounding at each stage. An unexposed row copies its base word; its absent branch has a saved reason instead of fake zero arithmetic.

Original item 0

Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD.

Item 0: all actual exposure/copy inputs and outputs
Saved sideFieldSaved value
inputsid0
inputsbaseP0.75
outputseffectiveP0.75
Item 0: inclusive decision, residual, square, absolute residual, underflow flag and bin
Saved sideFieldSaved value
inputsid0
inputslabel1
inputslabelOperand1
inputseffectiveP0.75
inputstau0.5
outputsprediction1
outputscorrect1
outputsresidual-0.25
outputssquare0.0625
outputsabsoluteResidual0.25
outputssquareUnderflow0
outputsbin1

Original item 1

Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD.

Item 1: all actual exposure/copy inputs and outputs
Saved sideFieldSaved value
inputsid1
inputsbaseP0.25
outputseffectiveP0.25
Item 1: inclusive decision, residual, square, absolute residual, underflow flag and bin
Saved sideFieldSaved value
inputsid1
inputslabel0
inputslabelOperand0
inputseffectiveP0.25
inputstau0.5
outputsprediction0
outputscorrect1
outputsresidual0.25
outputssquare0.0625
outputsabsoluteResidual0.25
outputssquareUnderflow0
outputsbin0

Original item 2

Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD.

Item 2: all actual exposure/copy inputs and outputs
Saved sideFieldSaved value
inputsid2
inputsbaseP0.75
outputseffectiveP0.75
Item 2: inclusive decision, residual, square, absolute residual, underflow flag and bin
Saved sideFieldSaved value
inputsid2
inputslabel0
inputslabelOperand0
inputseffectiveP0.75
inputstau0.5
outputsprediction1
outputscorrect0
outputsresidual0.75
outputssquare0.5625
outputsabsoluteResidual0.75
outputssquareUnderflow0
outputsbin1

Original item 3

Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD.

Item 3: all actual exposure/copy inputs and outputs
Saved sideFieldSaved value
inputsid3
inputsbaseP0.25
outputseffectiveP0.25
Item 3: inclusive decision, residual, square, absolute residual, underflow flag and bin
Saved sideFieldSaved value
inputsid3
inputslabel1
inputslabelOperand1
inputseffectiveP0.25
inputstau0.5
outputsprediction0
outputscorrect0
outputsresidual-0.75
outputssquare0.5625
outputsabsoluteResidual0.75
outputssquareUnderflow0
outputsbin0

Original item 4

Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD.

Item 4: all actual exposure/copy inputs and outputs
Saved sideFieldSaved value
inputsid4
inputsbaseP0.5
outputseffectiveP0.5
Item 4: inclusive decision, residual, square, absolute residual, underflow flag and bin
Saved sideFieldSaved value
inputsid4
inputslabel1
inputslabelOperand1
inputseffectiveP0.5
inputstau0.5
outputsprediction1
outputscorrect1
outputsresidual-0.5
outputssquare0.25
outputsabsoluteResidual0.5
outputssquareUnderflow0
outputsbin1

Original item 5

Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD.

Item 5: all actual exposure/copy inputs and outputs
Saved sideFieldSaved value
inputsid5
inputsbaseP0.5
outputseffectiveP0.5
Item 5: inclusive decision, residual, square, absolute residual, underflow flag and bin
Saved sideFieldSaved value
inputsid5
inputslabel0
inputslabelOperand0
inputseffectiveP0.5
inputstau0.5
outputsprediction1
outputscorrect0
outputsresidual0.5
outputssquare0.25
outputsabsoluteResidual0.5
outputssquareUnderflow0
outputsbin1

FULL scores all six rows; CLEAN scores the current IDs not exposed. To compare blend0 with blend1, keep m fixed so clean membership is matched. Changing m also selects a different cohort. The current summaries and questions always read the complete saved root; Previous/Next and the step menu only select an operation to inspect.

FULL: all six original items

Retained original IDs [0, 1, 2, 3, 4, 5]. Defined: retained original IDs in ascending order.

FULL: saved counts, squared-error sum and rounding evidence
Saved fieldSaved value
Count6
Correct3
TP2
FN1
FP2
TN1
PredictedPositive4
ActualPositive3
SSE1.75
MaxAbsoluteResidual0.75
SquareUnderflowCount0
ContributionUnderflowCount0

TP is a correct positive; FN a missed positive; FP a false positive; TN a correct negative. Accuracy divides Correct by Count. Brier divides the fresh squared-error sum (SSE) by Count. Precision divides TP by PredictedPositive; recall divides TP by ActualPositive. A missing denominator withholds only that metric.

FULL: actual saved metrics and their availability
Metric / meaningSaved value or explicit absenceSaved reason
Accuracy0.5Defined: correct/n with n>0.
Brier0.2916666666666667Defined: SSE/n with n>0.
Precision0.5Defined: TP/(TP+FP) with predictedPositive>0.
Recall0.6666666666666666Defined: TP/(TP+FN) with actualPositive>0.
CalibrationGap0.16666666666666666Defined: separately rounded occupied-bin weight/product/fold.
MaxAbsoluteBinGap0.25Saved maximum occupied-bin absolute gap; inspect contribution-underflow evidence as well.

Both fixed probability bins

These bins group forecasts of label1, independently of tau. Exactly 1/2 belongs to the upper bin. The means compare class1 forecasts with observed class1 labels, not decision accuracy.

Bin 0: [0,0.5)

Original IDs [1, 3]. Saved boundaries: bin=0; lower=0; upper=0.5; upperInclusive=0.

Defined: binN>0; both means, signed/absolute gap, weight and contribution exist.

full bin 0: actual count and fresh probability/label sums
Saved operandSaved value
binN2
cohortN6
sumP0.5
sumY1
full bin 0: complete saved means, gaps, weight, product and aggregate evidence
Saved resultSaved value
meanP0.25
observedFraction0.5
signedGap-0.25
absoluteGap0.25
weight0.3333333333333333
contribution0.08333333333333333
contributionUnderflow0
aggregate0.08333333333333333
maxAbsoluteBinGap0.25
contributionUnderflowCount0
Bin 1: [0.5,1]

Original IDs [0, 2, 4, 5]. Saved boundaries: bin=1; lower=0.5; upper=1; upperInclusive=1.

Defined: binN>0; both means, signed/absolute gap, weight and contribution exist.

full bin 1: actual count and fresh probability/label sums
Saved operandSaved value
binN4
cohortN6
sumP2.5
sumY2
full bin 1: complete saved means, gaps, weight, product and aggregate evidence
Saved resultSaved value
meanP0.625
observedFraction0.5
signedGap0.125
absoluteGap0.125
weight0.6666666666666666
contribution0.08333333333333333
contributionUnderflow0
aggregate0.16666666666666666
maxAbsoluteBinGap0.25
contributionUnderflowCount0

Every fresh leave-one-out score and its endpoint owner

Defined: n>=2; fresh folds for every omission and strict first-ID endpoint selection.

full: every omission in original-ID order, with fixed captured forecasts
Omitted original IDRetained original IDsRetained countCorrectFresh SSEAccuracyBrier
0[1, 2, 3, 4, 5]521.68750.40.3375
1[0, 2, 3, 4, 5]521.68750.40.3375
2[0, 1, 3, 4, 5]531.18750.60.2375
3[0, 1, 2, 4, 5]531.18750.60.2375
4[0, 1, 2, 3, 5]521.50.40.3
5[0, 1, 2, 3, 4]531.50.60.3
full: copied deletion endpoints and first original omission ID attaining each
EndpointSaved scoreOriginal omitted ID
AccuracyMin0.40
AccuracyMax0.62
BrierMin0.23752
BrierMax0.33750

Deletion holds forecasts and the cutoff fixed. Each omission freshly folds the retained squares from +0, rather than subtracting from a rounded total. Strict endpoint comparisons retain the first original omission ID on equality. These are descriptive deletion scores, not confidence intervals or population reliability guarantees.

CLEAN: the current unexposed original items

Retained original IDs [0, 1, 2, 3, 4, 5]. Defined: retained original IDs in ascending order.

CLEAN: saved counts, squared-error sum and rounding evidence
Saved fieldSaved value
Count6
Correct3
TP2
FN1
FP2
TN1
PredictedPositive4
ActualPositive3
SSE1.75
MaxAbsoluteResidual0.75
SquareUnderflowCount0
ContributionUnderflowCount0

TP is a correct positive; FN a missed positive; FP a false positive; TN a correct negative. Accuracy divides Correct by Count. Brier divides the fresh squared-error sum (SSE) by Count. Precision divides TP by PredictedPositive; recall divides TP by ActualPositive. A missing denominator withholds only that metric.

CLEAN: actual saved metrics and their availability
Metric / meaningSaved value or explicit absenceSaved reason
Accuracy0.5Defined: correct/n with n>0.
Brier0.2916666666666667Defined: SSE/n with n>0.
Precision0.5Defined: TP/(TP+FP) with predictedPositive>0.
Recall0.6666666666666666Defined: TP/(TP+FN) with actualPositive>0.
CalibrationGap0.16666666666666666Defined: separately rounded occupied-bin weight/product/fold.
MaxAbsoluteBinGap0.25Saved maximum occupied-bin absolute gap; inspect contribution-underflow evidence as well.

Both fixed probability bins

These bins group forecasts of label1, independently of tau. Exactly 1/2 belongs to the upper bin. The means compare class1 forecasts with observed class1 labels, not decision accuracy.

Bin 0: [0,0.5)

Original IDs [1, 3]. Saved boundaries: bin=0; lower=0; upper=0.5; upperInclusive=0.

Defined: binN>0; both means, signed/absolute gap, weight and contribution exist.

clean bin 0: actual count and fresh probability/label sums
Saved operandSaved value
binN2
cohortN6
sumP0.5
sumY1
clean bin 0: complete saved means, gaps, weight, product and aggregate evidence
Saved resultSaved value
meanP0.25
observedFraction0.5
signedGap-0.25
absoluteGap0.25
weight0.3333333333333333
contribution0.08333333333333333
contributionUnderflow0
aggregate0.08333333333333333
maxAbsoluteBinGap0.25
contributionUnderflowCount0
Bin 1: [0.5,1]

Original IDs [0, 2, 4, 5]. Saved boundaries: bin=1; lower=0.5; upper=1; upperInclusive=1.

Defined: binN>0; both means, signed/absolute gap, weight and contribution exist.

clean bin 1: actual count and fresh probability/label sums
Saved operandSaved value
binN4
cohortN6
sumP2.5
sumY2
clean bin 1: complete saved means, gaps, weight, product and aggregate evidence
Saved resultSaved value
meanP0.625
observedFraction0.5
signedGap0.125
absoluteGap0.125
weight0.6666666666666666
contribution0.08333333333333333
contributionUnderflow0
aggregate0.16666666666666666
maxAbsoluteBinGap0.25
contributionUnderflowCount0

Every fresh leave-one-out score and its endpoint owner

Defined: n>=2; fresh folds for every omission and strict first-ID endpoint selection.

clean: every omission in original-ID order, with fixed captured forecasts
Omitted original IDRetained original IDsRetained countCorrectFresh SSEAccuracyBrier
0[1, 2, 3, 4, 5]521.68750.40.3375
1[0, 2, 3, 4, 5]521.68750.40.3375
2[0, 1, 3, 4, 5]531.18750.60.2375
3[0, 1, 2, 4, 5]531.18750.60.2375
4[0, 1, 2, 3, 5]521.50.40.3
5[0, 1, 2, 3, 4]531.50.60.3
clean: copied deletion endpoints and first original omission ID attaining each
EndpointSaved scoreOriginal omitted ID
AccuracyMin0.40
AccuracyMax0.62
BrierMin0.23752
BrierMax0.33750

Deletion holds forecasts and the cutoff fixed. Each omission freshly folds the retained squares from +0, rather than subtracting from a rounded total. Strict endpoint comparisons retain the first original omission ID on equality. These are descriptive deletion scores, not confidence intervals or population reliability guarantees.

A nonzero residual whose square rounds to zero retains its residual, absolute residual and flag. Occupied-bin weight and absolute gap whose product rounds to zero retain the gap and contribution-underflow flag. Preserve maxima and counts; rounded Brier0 or calibration0 does not certify exact identity or reliability.

No elementary native, clock, numerical derivative, training, fitting or random draw. Scores describe this curated table only. Calibration, accuracy, forecast error and population reliability are different questions. All runtime validation remains deferred under the FluxGeo hold.

All nine current saved inputs in exact capture order
Complete current raw9: probabilities, cutoff, exposure count and blend
Raw fieldSaved value
p00.75
p10.25
p20.75
p30.25
p40.5
p50.5
tau0.5
m0
blend0

Exact own-data raw9 on a plain/null-prototype record: acquire all descriptors, inspect all descriptors, check all finite numbers, check domains in raw order, then ASCII prefix. No coercion, default merging, clipping, accessor execution or inactive-blend bypass. Only m is VALUE and normalizes either zero sign to integer0.

All float inputs, label operands, arithmetic, partials, metrics, boundaries and copies are WORD including -0. IDs, labels, exposure/prediction/correct/bin/underflow flags and counts are VALUE. abs(-0)=+0. Exposed blend0 need not preserve a base -0; unexposed copies do. Display precision never changes comparisons or arithmetic.

Complete tensor fallback: all seven fields and every cell (46 tensors)

Each actual tensor appears exactly once in this storage namespace, in saved order, with no truncated cells or nonexistent metric padding. Values preserve saved -0. All int32 cells are discrete VALUE; float64 cells are WORD except Raw index7 (m), which is VALUE. Declared display precision never changes the shown saved number.

reliability_Raw

Shape [9] · axes [RawField] · float64 · declared display precision 8

Captured raw9 in declared order; m is VALUE, all other cells WORD.

reliability_Raw: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.75
10.25
20.75
30.25
40.5
50.5
60.5
70
80

reliability_Labels

Shape [6] · axes [Item] · int32 · declared display precision 0

Fixed disclosed rubric labels in original ID order0..5.

reliability_Labels: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
01
10
20
31
41
50

reliability_Rows

Shape [6, 7] · axes [Item, RowWordField] · float64 · declared display precision 8

Actual saved baseP,labelOperand,effectiveP,tau,residual,square,absoluteResidual words per original item.

reliability_Rows: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.75
11
20.75
30.5
4-0.25
50.0625
60.25
70.25
80
90.25
100.5
110.25
120.0625
130.25
140.75
150
160.75
170.5
180.75
190.5625
200.75
210.25
221
230.25
240.5
25-0.75
260.5625
270.75
280.5
291
300.5
310.5
32-0.5
330.25
340.5
350.5
360
370.5
380.5
390.5
400.25
410.5

reliability_RowDecisions

Shape [6, 7] · axes [Item, RowDecisionField] · int32 · declared display precision 0

Actual id,label,exposed,prediction,correct,squareUnderflow,bin VALUE fields per original item.

reliability_RowDecisions: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
11
20
31
41
50
61
71
80
90
100
111
120
130
142
150
160
171
180
190
201
213
221
230
240
250
260
270
284
291
300
311
321
330
341
355
360
370
381
390
400
411

reliability_full_MemberIds

Shape [6] · axes [CohortItem] · int32 · declared display precision 0

Retained original IDs in ascending order; full0..5 or clean m..5.

reliability_full_MemberIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
11
22
33
44
55

reliability_full_Counts

Shape [10] · axes [CountField] · int32 · declared display precision 0

Actual n,correct,TP,FN,FP,TN,predictedPositive,actualPositive,squareUnderflowCount,contributionUnderflowCount VALUE fields.

reliability_full_Counts: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
06
13
22
31
42
51
64
73
80
90

reliability_full_Statistics

Shape [2] · axes [StatisticField] · float64 · declared display precision 8

Actual ordered SSE and maxAbsoluteResidual accumulator words; empty-cohort values are literal +0 initializers, not means.

reliability_full_Statistics: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
01.75
10.75

reliability_full_accuracy

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved accuracy division word; this tensor exists only with a positive denominator.

reliability_full_accuracy: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.5

reliability_full_brier

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved brier division word; this tensor exists only with a positive denominator.

reliability_full_brier: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.2916666666666667

reliability_full_precision

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved precision division word; this tensor exists only with a positive denominator.

reliability_full_precision: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.5

reliability_full_recall

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved recall division word; this tensor exists only with a positive denominator.

reliability_full_recall: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.6666666666666666

reliability_full_bin0_Count

Shape [1] · axes [Count] · int32 · declared display precision 0

Actual retained bin count, including a real empty-bin zero.

reliability_full_bin0_Count: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
02

reliability_full_bin0_Sums

Shape [2] · axes [BinSumField] · float64 · declared display precision 8

Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

reliability_full_bin0_Sums: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.5
11

reliability_full_bin0_MemberIds

Shape [2] · axes [BinItem] · int32 · declared display precision 0

Retained original IDs in this occupied bin, ascending.

reliability_full_bin0_MemberIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
01
13

reliability_full_bin0_Metrics

Shape [6] · axes [BinMetricField] · float64 · declared display precision 8

Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

reliability_full_bin0_Metrics: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.25
10.5
2-0.25
30.25
40.3333333333333333
50.08333333333333333

reliability_full_bin1_Count

Shape [1] · axes [Count] · int32 · declared display precision 0

Actual retained bin count, including a real empty-bin zero.

reliability_full_bin1_Count: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
04

reliability_full_bin1_Sums

Shape [2] · axes [BinSumField] · float64 · declared display precision 8

Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

reliability_full_bin1_Sums: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
02.5
12

reliability_full_bin1_MemberIds

Shape [4] · axes [BinItem] · int32 · declared display precision 0

Retained original IDs in this occupied bin, ascending.

reliability_full_bin1_MemberIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
12
24
35

reliability_full_bin1_Metrics

Shape [6] · axes [BinMetricField] · float64 · declared display precision 8

Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

reliability_full_bin1_Metrics: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.625
10.5
20.125
30.125
40.6666666666666666
50.08333333333333333

reliability_full_Calibration

Shape [2] · axes [CalibrationField] · float64 · declared display precision 8

Actual final occupied-bin contribution fold and maximum absolute gap words; no empty-cohort placeholder.

reliability_full_Calibration: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.16666666666666666
10.25

reliability_full_OmissionIds

Shape [6] · axes [Omission] · int32 · declared display precision 0

All omitted original IDs in ascending order.

reliability_full_OmissionIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
11
22
33
44
55

reliability_full_LooScores

Shape [6, 3] · axes [Omission, LooScoreField] · float64 · declared display precision 8

Actual fresh retained SSE,accuracy,brier words for each omission, in omission-ID order.

reliability_full_LooScores: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
01.6875
10.4
20.3375
31.6875
40.4
50.3375
61.1875
70.6
80.2375
91.1875
100.6
110.2375
121.5
130.4
140.3
151.5
160.6
170.3

reliability_full_LooCounts

Shape [6, 2] · axes [Omission, LooCountField] · int32 · declared display precision 0

Actual retained n,correct integer folds for every omission.

reliability_full_LooCounts: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
05
12
25
32
45
53
65
73
85
92
105
113

reliability_full_Endpoints

Shape [4] · axes [Endpoint] · float64 · declared display precision 8

Copied actual accuracyMin,accuracyMax,brierMin,brierMax words; descriptive deletion sensitivity only.

reliability_full_Endpoints: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.4
10.6
20.2375
30.3375

reliability_full_EndpointIds

Shape [4] · axes [Endpoint] · int32 · declared display precision 0

First original omission ID attaining each accuracyMin,accuracyMax,brierMin,brierMax endpoint.

reliability_full_EndpointIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
12
22
30

reliability_clean_MemberIds

Shape [6] · axes [CohortItem] · int32 · declared display precision 0

Retained original IDs in ascending order; full0..5 or clean m..5.

reliability_clean_MemberIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
11
22
33
44
55

reliability_clean_Counts

Shape [10] · axes [CountField] · int32 · declared display precision 0

Actual n,correct,TP,FN,FP,TN,predictedPositive,actualPositive,squareUnderflowCount,contributionUnderflowCount VALUE fields.

reliability_clean_Counts: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
06
13
22
31
42
51
64
73
80
90

reliability_clean_Statistics

Shape [2] · axes [StatisticField] · float64 · declared display precision 8

Actual ordered SSE and maxAbsoluteResidual accumulator words; empty-cohort values are literal +0 initializers, not means.

reliability_clean_Statistics: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
01.75
10.75

reliability_clean_accuracy

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved accuracy division word; this tensor exists only with a positive denominator.

reliability_clean_accuracy: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.5

reliability_clean_brier

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved brier division word; this tensor exists only with a positive denominator.

reliability_clean_brier: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.2916666666666667

reliability_clean_precision

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved precision division word; this tensor exists only with a positive denominator.

reliability_clean_precision: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.5

reliability_clean_recall

Shape [1] · axes [Metric] · float64 · declared display precision 8

Actual saved recall division word; this tensor exists only with a positive denominator.

reliability_clean_recall: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.6666666666666666

reliability_clean_bin0_Count

Shape [1] · axes [Count] · int32 · declared display precision 0

Actual retained bin count, including a real empty-bin zero.

reliability_clean_bin0_Count: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
02

reliability_clean_bin0_Sums

Shape [2] · axes [BinSumField] · float64 · declared display precision 8

Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

reliability_clean_bin0_Sums: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.5
11

reliability_clean_bin0_MemberIds

Shape [2] · axes [BinItem] · int32 · declared display precision 0

Retained original IDs in this occupied bin, ascending.

reliability_clean_bin0_MemberIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
01
13

reliability_clean_bin0_Metrics

Shape [6] · axes [BinMetricField] · float64 · declared display precision 8

Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

reliability_clean_bin0_Metrics: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.25
10.5
2-0.25
30.25
40.3333333333333333
50.08333333333333333

reliability_clean_bin1_Count

Shape [1] · axes [Count] · int32 · declared display precision 0

Actual retained bin count, including a real empty-bin zero.

reliability_clean_bin1_Count: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
04

reliability_clean_bin1_Sums

Shape [2] · axes [BinSumField] · float64 · declared display precision 8

Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

reliability_clean_bin1_Sums: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
02.5
12

reliability_clean_bin1_MemberIds

Shape [4] · axes [BinItem] · int32 · declared display precision 0

Retained original IDs in this occupied bin, ascending.

reliability_clean_bin1_MemberIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
12
24
35

reliability_clean_bin1_Metrics

Shape [6] · axes [BinMetricField] · float64 · declared display precision 8

Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

reliability_clean_bin1_Metrics: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.625
10.5
20.125
30.125
40.6666666666666666
50.08333333333333333

reliability_clean_Calibration

Shape [2] · axes [CalibrationField] · float64 · declared display precision 8

Actual final occupied-bin contribution fold and maximum absolute gap words; no empty-cohort placeholder.

reliability_clean_Calibration: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.16666666666666666
10.25

reliability_clean_OmissionIds

Shape [6] · axes [Omission] · int32 · declared display precision 0

All omitted original IDs in ascending order.

reliability_clean_OmissionIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
11
22
33
44
55

reliability_clean_LooScores

Shape [6, 3] · axes [Omission, LooScoreField] · float64 · declared display precision 8

Actual fresh retained SSE,accuracy,brier words for each omission, in omission-ID order.

reliability_clean_LooScores: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
01.6875
10.4
20.3375
31.6875
40.4
50.3375
61.1875
70.6
80.2375
91.1875
100.6
110.2375
121.5
130.4
140.3
151.5
160.6
170.3

reliability_clean_LooCounts

Shape [6, 2] · axes [Omission, LooCountField] · int32 · declared display precision 0

Actual retained n,correct integer folds for every omission.

reliability_clean_LooCounts: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
05
12
25
32
45
53
65
73
85
92
105
113

reliability_clean_Endpoints

Shape [4] · axes [Endpoint] · float64 · declared display precision 8

Copied actual accuracyMin,accuracyMax,brierMin,brierMax words; descriptive deletion sensitivity only.

reliability_clean_Endpoints: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00.4
10.6
20.2375
30.3375

reliability_clean_EndpointIds

Shape [4] · axes [Endpoint] · int32 · declared display precision 0

First original omission ID attaining each accuracyMin,accuracyMax,brierMin,brierMax endpoint.

reliability_clean_EndpointIds: every saved cell in original row-major storage order
Storage index (zero-based)Saved value
00
12
22
30
Complete frame fallback: all six fields and every operand (137 frames)

reliabilityTrace is exactly the unchanged decoderTrace alias. Each actual frame captures finite operands and outputs once, snapshots detached plain data and enforces unique nonempty IDs and the512 cap. Root aliases frameId_key copy every saved frame output in frame/key order; they never recompute a metric. No StepRecord.state or invented unexecuted arithmetic is added.

Set up six disclosed rubric forecasts

setup — selected saved step

raw=[p0,p1,p2,p3,p4,p5,tau,m,blend]; items=6; bins=2

Capture the complete validated state before scoring. These are hand-set forecasts about fixed arithmetic candidates, not generated answers, measured model behavior or a random test sample.

Saved inputs
p0
0.75
p1
0.25
p2
0.75
p3
0.25
p4
0.5
p5
0.5
tau
0.5
m
0
blend
0
Saved outputs
p0
0.75
p1
0.25
p2
0.75
p3
0.25
p4
0.5
p5
0.5
tau
0.5
m
0
blend
0
itemCount
6
rawInputCount
9
binCount
2

Capture the complete evaluation state

reliability_raw

raw=[p0,p1,p2,p3,p4,p5,tau,m,blend]

All nine fields have passed descriptors, finite checks and domains before this record or any exposure branch. Preserve eight float words; m is a normalized discrete count.

Saved inputs
p0
0.75
p1
0.25
p2
0.75
p3
0.25
p4
0.5
p5
0.5
tau
0.5
m
0
blend
0
Saved outputs
p0
0.75
p1
0.25
p2
0.75
p3
0.25
p4
0.5
p5
0.5
tau
0.5
m
0
blend
0

Copy unexposed forecast for item 0

reliability_copy_0

effectiveP=baseP WORD copy

The exposure branch is absent. No delta, taint or exposure-addition result is manufactured, including at blend0.

Saved inputs
id
0
baseP
0.75
Saved outputs
effectiveP
0.75

Score saved forecast for item 0

reliability_row_0

prediction=(effectiveP>=tau); correct=(prediction===label); residual=effectiveP-labelOperand; square=residual*residual; absoluteResidual=abs(residual); bin=(effectiveP<0.5?0:1)

Use represented inclusive threshold ties and fixed probability bins. A nonzero residual with rounded square0 remains visible through its underflow flag; no epsilon or display rounding is used.

Saved inputs
id
0
label
1
labelOperand
1
effectiveP
0.75
tau
0.5
Saved outputs
prediction
1
correct
1
residual
-0.25
square
0.0625
absoluteResidual
0.25
squareUnderflow
0
bin
1

Copy unexposed forecast for item 1

reliability_copy_1

effectiveP=baseP WORD copy

The exposure branch is absent. No delta, taint or exposure-addition result is manufactured, including at blend0.

Saved inputs
id
1
baseP
0.25
Saved outputs
effectiveP
0.25

Score saved forecast for item 1

reliability_row_1

prediction=(effectiveP>=tau); correct=(prediction===label); residual=effectiveP-labelOperand; square=residual*residual; absoluteResidual=abs(residual); bin=(effectiveP<0.5?0:1)

Use represented inclusive threshold ties and fixed probability bins. A nonzero residual with rounded square0 remains visible through its underflow flag; no epsilon or display rounding is used.

Saved inputs
id
1
label
0
labelOperand
0
effectiveP
0.25
tau
0.5
Saved outputs
prediction
0
correct
1
residual
0.25
square
0.0625
absoluteResidual
0.25
squareUnderflow
0
bin
0

Copy unexposed forecast for item 2

reliability_copy_2

effectiveP=baseP WORD copy

The exposure branch is absent. No delta, taint or exposure-addition result is manufactured, including at blend0.

Saved inputs
id
2
baseP
0.75
Saved outputs
effectiveP
0.75

Score saved forecast for item 2

reliability_row_2

prediction=(effectiveP>=tau); correct=(prediction===label); residual=effectiveP-labelOperand; square=residual*residual; absoluteResidual=abs(residual); bin=(effectiveP<0.5?0:1)

Use represented inclusive threshold ties and fixed probability bins. A nonzero residual with rounded square0 remains visible through its underflow flag; no epsilon or display rounding is used.

Saved inputs
id
2
label
0
labelOperand
0
effectiveP
0.75
tau
0.5
Saved outputs
prediction
1
correct
0
residual
0.75
square
0.5625
absoluteResidual
0.75
squareUnderflow
0
bin
1

Copy unexposed forecast for item 3

reliability_copy_3

effectiveP=baseP WORD copy

The exposure branch is absent. No delta, taint or exposure-addition result is manufactured, including at blend0.

Saved inputs
id
3
baseP
0.25
Saved outputs
effectiveP
0.25

Score saved forecast for item 3

reliability_row_3

prediction=(effectiveP>=tau); correct=(prediction===label); residual=effectiveP-labelOperand; square=residual*residual; absoluteResidual=abs(residual); bin=(effectiveP<0.5?0:1)

Use represented inclusive threshold ties and fixed probability bins. A nonzero residual with rounded square0 remains visible through its underflow flag; no epsilon or display rounding is used.

Saved inputs
id
3
label
1
labelOperand
1
effectiveP
0.25
tau
0.5
Saved outputs
prediction
0
correct
0
residual
-0.75
square
0.5625
absoluteResidual
0.75
squareUnderflow
0
bin
0

Copy unexposed forecast for item 4

reliability_copy_4

effectiveP=baseP WORD copy

The exposure branch is absent. No delta, taint or exposure-addition result is manufactured, including at blend0.

Saved inputs
id
4
baseP
0.5
Saved outputs
effectiveP
0.5

Score saved forecast for item 4

reliability_row_4

prediction=(effectiveP>=tau); correct=(prediction===label); residual=effectiveP-labelOperand; square=residual*residual; absoluteResidual=abs(residual); bin=(effectiveP<0.5?0:1)

Use represented inclusive threshold ties and fixed probability bins. A nonzero residual with rounded square0 remains visible through its underflow flag; no epsilon or display rounding is used.

Saved inputs
id
4
label
1
labelOperand
1
effectiveP
0.5
tau
0.5
Saved outputs
prediction
1
correct
1
residual
-0.5
square
0.25
absoluteResidual
0.5
squareUnderflow
0
bin
1

Copy unexposed forecast for item 5

reliability_copy_5

effectiveP=baseP WORD copy

The exposure branch is absent. No delta, taint or exposure-addition result is manufactured, including at blend0.

Saved inputs
id
5
baseP
0.5
Saved outputs
effectiveP
0.5

Score saved forecast for item 5

reliability_row_5

prediction=(effectiveP>=tau); correct=(prediction===label); residual=effectiveP-labelOperand; square=residual*residual; absoluteResidual=abs(residual); bin=(effectiveP<0.5?0:1)

Use represented inclusive threshold ties and fixed probability bins. A nonzero residual with rounded square0 remains visible through its underflow flag; no epsilon or display rounding is used.

Saved inputs
id
5
label
0
labelOperand
0
effectiveP
0.5
tau
0.5
Saved outputs
prediction
1
correct
0
residual
0.5
square
0.25
absoluteResidual
0.5
squareUnderflow
0
bin
1

Full cohort: fresh accumulators

reliability_full_start

integer counts=0; SSE=+0; maxima=+0; calibrationSum=+0

Start independent reductions from literal zeros. Empty cohorts retain these real count/sum initializers but have no means, rates, calibration score or deletion endpoints.

Saved inputs
firstId
0
sourceCount
6
Saved outputs
n
0
correct
0
TP
0
FN
0
FP
0
TN
0
SSE
0
maxAbsoluteResidual
0
squareUnderflowCount
0
calibrationSum
0
maxAbsoluteBinGap
0
contributionUnderflowCount
0

Full cohort: retain item 0

reliability_full_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
0
label
1
prediction
1
rowCorrect
1
square
0.0625
absoluteResidual
0.25
squareUnderflow
0
previousN
0
previousCorrect
0
previousTP
0
previousFN
0
previousFP
0
previousTN
0
previousSSE
0
previousMaxAbsoluteResidual
0
previousSquareUnderflowCount
0
Saved outputs
n
1
correct
1
TP
1
FN
0
FP
0
TN
0
SSE
0.0625
maxAbsoluteResidual
0.25
squareUnderflowCount
0

Full cohort: retain item 1

reliability_full_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
1
label
0
prediction
0
rowCorrect
1
square
0.0625
absoluteResidual
0.25
squareUnderflow
0
previousN
1
previousCorrect
1
previousTP
1
previousFN
0
previousFP
0
previousTN
0
previousSSE
0.0625
previousMaxAbsoluteResidual
0.25
previousSquareUnderflowCount
0
Saved outputs
n
2
correct
2
TP
1
FN
0
FP
0
TN
1
SSE
0.125
maxAbsoluteResidual
0.25
squareUnderflowCount
0

Full cohort: retain item 2

reliability_full_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
2
label
0
prediction
1
rowCorrect
0
square
0.5625
absoluteResidual
0.75
squareUnderflow
0
previousN
2
previousCorrect
2
previousTP
1
previousFN
0
previousFP
0
previousTN
1
previousSSE
0.125
previousMaxAbsoluteResidual
0.25
previousSquareUnderflowCount
0
Saved outputs
n
3
correct
2
TP
1
FN
0
FP
1
TN
1
SSE
0.6875
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Full cohort: retain item 3

reliability_full_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
3
label
1
prediction
0
rowCorrect
0
square
0.5625
absoluteResidual
0.75
squareUnderflow
0
previousN
3
previousCorrect
2
previousTP
1
previousFN
0
previousFP
1
previousTN
1
previousSSE
0.6875
previousMaxAbsoluteResidual
0.75
previousSquareUnderflowCount
0
Saved outputs
n
4
correct
2
TP
1
FN
1
FP
1
TN
1
SSE
1.25
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Full cohort: retain item 4

reliability_full_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
4
label
1
prediction
1
rowCorrect
1
square
0.25
absoluteResidual
0.5
squareUnderflow
0
previousN
4
previousCorrect
2
previousTP
1
previousFN
1
previousFP
1
previousTN
1
previousSSE
1.25
previousMaxAbsoluteResidual
0.75
previousSquareUnderflowCount
0
Saved outputs
n
5
correct
3
TP
2
FN
1
FP
1
TN
1
SSE
1.5
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Full cohort: retain item 5

reliability_full_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
5
label
0
prediction
1
rowCorrect
0
square
0.25
absoluteResidual
0.5
squareUnderflow
0
previousN
5
previousCorrect
3
previousTP
2
previousFN
1
previousFP
1
previousTN
1
previousSSE
1.5
previousMaxAbsoluteResidual
0.75
previousSquareUnderflowCount
0
Saved outputs
n
6
correct
3
TP
2
FN
1
FP
2
TN
1
SSE
1.75
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Full cohort: available score divisions

reliability_full_metrics

predictedPositive=TP+FP; actualPositive=TP+FN; accuracy=correct/n; brier=SSE/n; precision=TP/predictedPositive; recall=TP/actualPositive, only for positive denominators

Omit each undefined division independently and save its specific reason. A defined zero is retained; no null, NaN, epsilon denominator or fake score fills an absent metric.

Saved inputs
n
6
correct
3
TP
2
FN
1
FP
2
TN
1
SSE
1.75
Saved outputs
predictedPositive
4
actualPositive
3
accuracy
0.5
brier
0.2916666666666667
precision
0.5
recall
0.6666666666666666

Full cohort: initialize probability bin 0

reliability_full_bin0_start

binCount=0; sumP=+0; sumY=+0

Bins are fixed class1 probability intervals, independent of the decision cutoff. The exact half belongs to the upper bin; start fresh ordered sums even when the bin is empty.

Saved inputs
bin
0
lower
0
upper
0.5
upperInclusive
0
Saved outputs
n
0
sumP
0
sumY
0

Full cohort: bin 0 retains item 1

reliability_full_bin0_fold_1

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
1
previousN
0
previousSumP
0
effectiveP
0.25
previousSumY
0
labelOperand
0
Saved outputs
n
1
sumP
0.25
sumY
0

Full cohort: bin 0 retains item 3

reliability_full_bin0_fold_3

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
3
previousN
1
previousSumP
0.25
effectiveP
0.25
previousSumY
0
labelOperand
1
Saved outputs
n
2
sumP
0.5
sumY
1

Full cohort: score occupied bin 0

reliability_full_bin0_finish

meanP=sumP/binN; observedFraction=sumY/binN; signedGap=meanP-observedFraction; absoluteGap=abs(signedGap); weight=binN/cohortN; contribution=weight*absoluteGap; aggregate=previousAggregate+contribution

Each division, subtraction, absolute value, multiplication and aggregate addition saves its actual operands/results in this order. Fold occupied bins low then high; retain gap maxima and rounded-contribution underflow evidence.

Saved inputs
binN
2
cohortN
6
sumP
0.5
sumY
1
previousAggregate
0
previousMaxAbsoluteBinGap
0
previousContributionUnderflowCount
0
Saved outputs
meanP
0.25
observedFraction
0.5
signedGap
-0.25
absoluteGap
0.25
weight
0.3333333333333333
contribution
0.08333333333333333
contributionUnderflow
0
aggregate
0.08333333333333333
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0

Full cohort: initialize probability bin 1

reliability_full_bin1_start

binCount=0; sumP=+0; sumY=+0

Bins are fixed class1 probability intervals, independent of the decision cutoff. The exact half belongs to the upper bin; start fresh ordered sums even when the bin is empty.

Saved inputs
bin
1
lower
0.5
upper
1
upperInclusive
1
Saved outputs
n
0
sumP
0
sumY
0

Full cohort: bin 1 retains item 0

reliability_full_bin1_fold_0

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
0
previousN
0
previousSumP
0
effectiveP
0.75
previousSumY
0
labelOperand
1
Saved outputs
n
1
sumP
0.75
sumY
1

Full cohort: bin 1 retains item 2

reliability_full_bin1_fold_2

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
2
previousN
1
previousSumP
0.75
effectiveP
0.75
previousSumY
1
labelOperand
0
Saved outputs
n
2
sumP
1.5
sumY
1

Full cohort: bin 1 retains item 4

reliability_full_bin1_fold_4

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
4
previousN
2
previousSumP
1.5
effectiveP
0.5
previousSumY
1
labelOperand
1
Saved outputs
n
3
sumP
2
sumY
2

Full cohort: bin 1 retains item 5

reliability_full_bin1_fold_5

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
5
previousN
3
previousSumP
2
effectiveP
0.5
previousSumY
2
labelOperand
0
Saved outputs
n
4
sumP
2.5
sumY
2

Full cohort: score occupied bin 1

reliability_full_bin1_finish

meanP=sumP/binN; observedFraction=sumY/binN; signedGap=meanP-observedFraction; absoluteGap=abs(signedGap); weight=binN/cohortN; contribution=weight*absoluteGap; aggregate=previousAggregate+contribution

Each division, subtraction, absolute value, multiplication and aggregate addition saves its actual operands/results in this order. Fold occupied bins low then high; retain gap maxima and rounded-contribution underflow evidence.

Saved inputs
binN
4
cohortN
6
sumP
2.5
sumY
2
previousAggregate
0.08333333333333333
previousMaxAbsoluteBinGap
0.25
previousContributionUnderflowCount
0
Saved outputs
meanP
0.625
observedFraction
0.5
signedGap
0.125
absoluteGap
0.125
weight
0.6666666666666666
contribution
0.08333333333333333
contributionUnderflow
0
aggregate
0.16666666666666666
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0

Full cohort: saved calibration evidence

reliability_full_calibration

copy final occupied-bin fold and maximum only when n>0

A zero rounded aggregate is separate from maximum gap and underflow evidence. Empty cohorts have no calibration score, even though their initialized fold/counts remain saved.

Saved inputs
n
6
aggregate
0.16666666666666666
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0
Saved outputs
calibrationGap
0.16666666666666666
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0

Full cohort: omit 0, retain 1

reliability_full_loo_0_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
1
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Full cohort: omit 0, retain 2

reliability_full_loo_0_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
2
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
0
square
0.5625
Saved outputs
n
2
correct
1
SSE
0.625

Full cohort: omit 0, retain 3

reliability_full_loo_0_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
3
previousN
2
previousCorrect
1
previousSSE
0.625
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
1
SSE
1.1875

Full cohort: omit 0, retain 4

reliability_full_loo_0_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
4
previousN
3
previousCorrect
1
previousSSE
1.1875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
2
SSE
1.4375

Full cohort: omit 0, retain 5

reliability_full_loo_0_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
5
previousN
4
previousCorrect
2
previousSSE
1.4375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
2
SSE
1.6875

Full cohort: scores omitting 0

reliability_full_loo_0_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
0
n
5
correct
2
SSE
1.6875
Saved outputs
accuracy
0.4
brier
0.3375

Full cohort: compare omission 0 endpoints

reliability_full_loo_0_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
0
accuracy
0.4
brier
0.3375
Saved outputs
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0

Full cohort: omit 1, retain 0

reliability_full_loo_1_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Full cohort: omit 1, retain 2

reliability_full_loo_1_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
2
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
0
square
0.5625
Saved outputs
n
2
correct
1
SSE
0.625

Full cohort: omit 1, retain 3

reliability_full_loo_1_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
3
previousN
2
previousCorrect
1
previousSSE
0.625
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
1
SSE
1.1875

Full cohort: omit 1, retain 4

reliability_full_loo_1_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
4
previousN
3
previousCorrect
1
previousSSE
1.1875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
2
SSE
1.4375

Full cohort: omit 1, retain 5

reliability_full_loo_1_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
5
previousN
4
previousCorrect
2
previousSSE
1.4375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
2
SSE
1.6875

Full cohort: scores omitting 1

reliability_full_loo_1_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
1
n
5
correct
2
SSE
1.6875
Saved outputs
accuracy
0.4
brier
0.3375

Full cohort: compare omission 1 endpoints

reliability_full_loo_1_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
1
accuracy
0.4
brier
0.3375
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0

Full cohort: omit 2, retain 0

reliability_full_loo_2_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Full cohort: omit 2, retain 1

reliability_full_loo_2_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Full cohort: omit 2, retain 3

reliability_full_loo_2_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
3
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Full cohort: omit 2, retain 4

reliability_full_loo_2_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
4
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
3
SSE
0.9375

Full cohort: omit 2, retain 5

reliability_full_loo_2_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
5
previousN
4
previousCorrect
3
previousSSE
0.9375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
3
SSE
1.1875

Full cohort: scores omitting 2

reliability_full_loo_2_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
2
n
5
correct
3
SSE
1.1875
Saved outputs
accuracy
0.6
brier
0.2375

Full cohort: compare omission 2 endpoints

reliability_full_loo_2_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
2
accuracy
0.6
brier
0.2375
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Full cohort: omit 3, retain 0

reliability_full_loo_3_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Full cohort: omit 3, retain 1

reliability_full_loo_3_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Full cohort: omit 3, retain 2

reliability_full_loo_3_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
2
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Full cohort: omit 3, retain 4

reliability_full_loo_3_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
4
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
3
SSE
0.9375

Full cohort: omit 3, retain 5

reliability_full_loo_3_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
5
previousN
4
previousCorrect
3
previousSSE
0.9375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
3
SSE
1.1875

Full cohort: scores omitting 3

reliability_full_loo_3_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
3
n
5
correct
3
SSE
1.1875
Saved outputs
accuracy
0.6
brier
0.2375

Full cohort: compare omission 3 endpoints

reliability_full_loo_3_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
3
accuracy
0.6
brier
0.2375
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Full cohort: omit 4, retain 0

reliability_full_loo_4_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Full cohort: omit 4, retain 1

reliability_full_loo_4_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Full cohort: omit 4, retain 2

reliability_full_loo_4_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
2
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Full cohort: omit 4, retain 3

reliability_full_loo_4_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
3
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
0
square
0.5625
Saved outputs
n
4
correct
2
SSE
1.25

Full cohort: omit 4, retain 5

reliability_full_loo_4_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
5
previousN
4
previousCorrect
2
previousSSE
1.25
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
2
SSE
1.5

Full cohort: scores omitting 4

reliability_full_loo_4_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
4
n
5
correct
2
SSE
1.5
Saved outputs
accuracy
0.4
brier
0.3

Full cohort: compare omission 4 endpoints

reliability_full_loo_4_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
4
accuracy
0.4
brier
0.3
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Full cohort: omit 5, retain 0

reliability_full_loo_5_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Full cohort: omit 5, retain 1

reliability_full_loo_5_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Full cohort: omit 5, retain 2

reliability_full_loo_5_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
2
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Full cohort: omit 5, retain 3

reliability_full_loo_5_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
3
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
0
square
0.5625
Saved outputs
n
4
correct
2
SSE
1.25

Full cohort: omit 5, retain 4

reliability_full_loo_5_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
4
previousN
4
previousCorrect
2
previousSSE
1.25
rowCorrect
1
square
0.25
Saved outputs
n
5
correct
3
SSE
1.5

Full cohort: scores omitting 5

reliability_full_loo_5_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
5
n
5
correct
3
SSE
1.5
Saved outputs
accuracy
0.6
brier
0.3

Full cohort: compare omission 5 endpoints

reliability_full_loo_5_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
5
accuracy
0.6
brier
0.3
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Clean cohort: fresh accumulators

reliability_clean_start

integer counts=0; SSE=+0; maxima=+0; calibrationSum=+0

Start independent reductions from literal zeros. Empty cohorts retain these real count/sum initializers but have no means, rates, calibration score or deletion endpoints.

Saved inputs
firstId
0
sourceCount
6
Saved outputs
n
0
correct
0
TP
0
FN
0
FP
0
TN
0
SSE
0
maxAbsoluteResidual
0
squareUnderflowCount
0
calibrationSum
0
maxAbsoluteBinGap
0
contributionUnderflowCount
0

Clean cohort: retain item 0

reliability_clean_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
0
label
1
prediction
1
rowCorrect
1
square
0.0625
absoluteResidual
0.25
squareUnderflow
0
previousN
0
previousCorrect
0
previousTP
0
previousFN
0
previousFP
0
previousTN
0
previousSSE
0
previousMaxAbsoluteResidual
0
previousSquareUnderflowCount
0
Saved outputs
n
1
correct
1
TP
1
FN
0
FP
0
TN
0
SSE
0.0625
maxAbsoluteResidual
0.25
squareUnderflowCount
0

Clean cohort: retain item 1

reliability_clean_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
1
label
0
prediction
0
rowCorrect
1
square
0.0625
absoluteResidual
0.25
squareUnderflow
0
previousN
1
previousCorrect
1
previousTP
1
previousFN
0
previousFP
0
previousTN
0
previousSSE
0.0625
previousMaxAbsoluteResidual
0.25
previousSquareUnderflowCount
0
Saved outputs
n
2
correct
2
TP
1
FN
0
FP
0
TN
1
SSE
0.125
maxAbsoluteResidual
0.25
squareUnderflowCount
0

Clean cohort: retain item 2

reliability_clean_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
2
label
0
prediction
1
rowCorrect
0
square
0.5625
absoluteResidual
0.75
squareUnderflow
0
previousN
2
previousCorrect
2
previousTP
1
previousFN
0
previousFP
0
previousTN
1
previousSSE
0.125
previousMaxAbsoluteResidual
0.25
previousSquareUnderflowCount
0
Saved outputs
n
3
correct
2
TP
1
FN
0
FP
1
TN
1
SSE
0.6875
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Clean cohort: retain item 3

reliability_clean_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
3
label
1
prediction
0
rowCorrect
0
square
0.5625
absoluteResidual
0.75
squareUnderflow
0
previousN
3
previousCorrect
2
previousTP
1
previousFN
0
previousFP
1
previousTN
1
previousSSE
0.6875
previousMaxAbsoluteResidual
0.75
previousSquareUnderflowCount
0
Saved outputs
n
4
correct
2
TP
1
FN
1
FP
1
TN
1
SSE
1.25
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Clean cohort: retain item 4

reliability_clean_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
4
label
1
prediction
1
rowCorrect
1
square
0.25
absoluteResidual
0.5
squareUnderflow
0
previousN
4
previousCorrect
2
previousTP
1
previousFN
1
previousFP
1
previousTN
1
previousSSE
1.25
previousMaxAbsoluteResidual
0.75
previousSquareUnderflowCount
0
Saved outputs
n
5
correct
3
TP
2
FN
1
FP
1
TN
1
SSE
1.5
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Clean cohort: retain item 5

reliability_clean_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum

Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.

Saved inputs
id
5
label
0
prediction
1
rowCorrect
0
square
0.25
absoluteResidual
0.5
squareUnderflow
0
previousN
5
previousCorrect
3
previousTP
2
previousFN
1
previousFP
1
previousTN
1
previousSSE
1.5
previousMaxAbsoluteResidual
0.75
previousSquareUnderflowCount
0
Saved outputs
n
6
correct
3
TP
2
FN
1
FP
2
TN
1
SSE
1.75
maxAbsoluteResidual
0.75
squareUnderflowCount
0

Clean cohort: available score divisions

reliability_clean_metrics

predictedPositive=TP+FP; actualPositive=TP+FN; accuracy=correct/n; brier=SSE/n; precision=TP/predictedPositive; recall=TP/actualPositive, only for positive denominators

Omit each undefined division independently and save its specific reason. A defined zero is retained; no null, NaN, epsilon denominator or fake score fills an absent metric.

Saved inputs
n
6
correct
3
TP
2
FN
1
FP
2
TN
1
SSE
1.75
Saved outputs
predictedPositive
4
actualPositive
3
accuracy
0.5
brier
0.2916666666666667
precision
0.5
recall
0.6666666666666666

Clean cohort: initialize probability bin 0

reliability_clean_bin0_start

binCount=0; sumP=+0; sumY=+0

Bins are fixed class1 probability intervals, independent of the decision cutoff. The exact half belongs to the upper bin; start fresh ordered sums even when the bin is empty.

Saved inputs
bin
0
lower
0
upper
0.5
upperInclusive
0
Saved outputs
n
0
sumP
0
sumY
0

Clean cohort: bin 0 retains item 1

reliability_clean_bin0_fold_1

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
1
previousN
0
previousSumP
0
effectiveP
0.25
previousSumY
0
labelOperand
0
Saved outputs
n
1
sumP
0.25
sumY
0

Clean cohort: bin 0 retains item 3

reliability_clean_bin0_fold_3

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
3
previousN
1
previousSumP
0.25
effectiveP
0.25
previousSumY
0
labelOperand
1
Saved outputs
n
2
sumP
0.5
sumY
1

Clean cohort: score occupied bin 0

reliability_clean_bin0_finish

meanP=sumP/binN; observedFraction=sumY/binN; signedGap=meanP-observedFraction; absoluteGap=abs(signedGap); weight=binN/cohortN; contribution=weight*absoluteGap; aggregate=previousAggregate+contribution

Each division, subtraction, absolute value, multiplication and aggregate addition saves its actual operands/results in this order. Fold occupied bins low then high; retain gap maxima and rounded-contribution underflow evidence.

Saved inputs
binN
2
cohortN
6
sumP
0.5
sumY
1
previousAggregate
0
previousMaxAbsoluteBinGap
0
previousContributionUnderflowCount
0
Saved outputs
meanP
0.25
observedFraction
0.5
signedGap
-0.25
absoluteGap
0.25
weight
0.3333333333333333
contribution
0.08333333333333333
contributionUnderflow
0
aggregate
0.08333333333333333
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0

Clean cohort: initialize probability bin 1

reliability_clean_bin1_start

binCount=0; sumP=+0; sumY=+0

Bins are fixed class1 probability intervals, independent of the decision cutoff. The exact half belongs to the upper bin; start fresh ordered sums even when the bin is empty.

Saved inputs
bin
1
lower
0.5
upper
1
upperInclusive
1
Saved outputs
n
0
sumP
0
sumY
0

Clean cohort: bin 1 retains item 0

reliability_clean_bin1_fold_0

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
0
previousN
0
previousSumP
0
effectiveP
0.75
previousSumY
0
labelOperand
1
Saved outputs
n
1
sumP
0.75
sumY
1

Clean cohort: bin 1 retains item 2

reliability_clean_bin1_fold_2

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
2
previousN
1
previousSumP
0.75
effectiveP
0.75
previousSumY
1
labelOperand
0
Saved outputs
n
2
sumP
1.5
sumY
1

Clean cohort: bin 1 retains item 4

reliability_clean_bin1_fold_4

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
4
previousN
2
previousSumP
1.5
effectiveP
0.5
previousSumY
1
labelOperand
1
Saved outputs
n
3
sumP
2
sumY
2

Clean cohort: bin 1 retains item 5

reliability_clean_bin1_fold_5

n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand

Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.

Saved inputs
id
5
previousN
3
previousSumP
2
effectiveP
0.5
previousSumY
2
labelOperand
0
Saved outputs
n
4
sumP
2.5
sumY
2

Clean cohort: score occupied bin 1

reliability_clean_bin1_finish

meanP=sumP/binN; observedFraction=sumY/binN; signedGap=meanP-observedFraction; absoluteGap=abs(signedGap); weight=binN/cohortN; contribution=weight*absoluteGap; aggregate=previousAggregate+contribution

Each division, subtraction, absolute value, multiplication and aggregate addition saves its actual operands/results in this order. Fold occupied bins low then high; retain gap maxima and rounded-contribution underflow evidence.

Saved inputs
binN
4
cohortN
6
sumP
2.5
sumY
2
previousAggregate
0.08333333333333333
previousMaxAbsoluteBinGap
0.25
previousContributionUnderflowCount
0
Saved outputs
meanP
0.625
observedFraction
0.5
signedGap
0.125
absoluteGap
0.125
weight
0.6666666666666666
contribution
0.08333333333333333
contributionUnderflow
0
aggregate
0.16666666666666666
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0

Clean cohort: saved calibration evidence

reliability_clean_calibration

copy final occupied-bin fold and maximum only when n>0

A zero rounded aggregate is separate from maximum gap and underflow evidence. Empty cohorts have no calibration score, even though their initialized fold/counts remain saved.

Saved inputs
n
6
aggregate
0.16666666666666666
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0
Saved outputs
calibrationGap
0.16666666666666666
maxAbsoluteBinGap
0.25
contributionUnderflowCount
0

Clean cohort: omit 0, retain 1

reliability_clean_loo_0_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
1
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Clean cohort: omit 0, retain 2

reliability_clean_loo_0_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
2
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
0
square
0.5625
Saved outputs
n
2
correct
1
SSE
0.625

Clean cohort: omit 0, retain 3

reliability_clean_loo_0_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
3
previousN
2
previousCorrect
1
previousSSE
0.625
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
1
SSE
1.1875

Clean cohort: omit 0, retain 4

reliability_clean_loo_0_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
4
previousN
3
previousCorrect
1
previousSSE
1.1875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
2
SSE
1.4375

Clean cohort: omit 0, retain 5

reliability_clean_loo_0_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
0
id
5
previousN
4
previousCorrect
2
previousSSE
1.4375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
2
SSE
1.6875

Clean cohort: scores omitting 0

reliability_clean_loo_0_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
0
n
5
correct
2
SSE
1.6875
Saved outputs
accuracy
0.4
brier
0.3375

Clean cohort: compare omission 0 endpoints

reliability_clean_loo_0_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
0
accuracy
0.4
brier
0.3375
Saved outputs
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0

Clean cohort: omit 1, retain 0

reliability_clean_loo_1_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Clean cohort: omit 1, retain 2

reliability_clean_loo_1_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
2
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
0
square
0.5625
Saved outputs
n
2
correct
1
SSE
0.625

Clean cohort: omit 1, retain 3

reliability_clean_loo_1_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
3
previousN
2
previousCorrect
1
previousSSE
0.625
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
1
SSE
1.1875

Clean cohort: omit 1, retain 4

reliability_clean_loo_1_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
4
previousN
3
previousCorrect
1
previousSSE
1.1875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
2
SSE
1.4375

Clean cohort: omit 1, retain 5

reliability_clean_loo_1_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
1
id
5
previousN
4
previousCorrect
2
previousSSE
1.4375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
2
SSE
1.6875

Clean cohort: scores omitting 1

reliability_clean_loo_1_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
1
n
5
correct
2
SSE
1.6875
Saved outputs
accuracy
0.4
brier
0.3375

Clean cohort: compare omission 1 endpoints

reliability_clean_loo_1_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
1
accuracy
0.4
brier
0.3375
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0

Clean cohort: omit 2, retain 0

reliability_clean_loo_2_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Clean cohort: omit 2, retain 1

reliability_clean_loo_2_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Clean cohort: omit 2, retain 3

reliability_clean_loo_2_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
3
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Clean cohort: omit 2, retain 4

reliability_clean_loo_2_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
4
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
3
SSE
0.9375

Clean cohort: omit 2, retain 5

reliability_clean_loo_2_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
2
id
5
previousN
4
previousCorrect
3
previousSSE
0.9375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
3
SSE
1.1875

Clean cohort: scores omitting 2

reliability_clean_loo_2_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
2
n
5
correct
3
SSE
1.1875
Saved outputs
accuracy
0.6
brier
0.2375

Clean cohort: compare omission 2 endpoints

reliability_clean_loo_2_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
2
accuracy
0.6
brier
0.2375
accuracyMin
0.4
accuracyMax
0.4
brierMin
0.3375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
0
brierMinId
0
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Clean cohort: omit 3, retain 0

reliability_clean_loo_3_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Clean cohort: omit 3, retain 1

reliability_clean_loo_3_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Clean cohort: omit 3, retain 2

reliability_clean_loo_3_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
2
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Clean cohort: omit 3, retain 4

reliability_clean_loo_3_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
4
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
1
square
0.25
Saved outputs
n
4
correct
3
SSE
0.9375

Clean cohort: omit 3, retain 5

reliability_clean_loo_3_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
3
id
5
previousN
4
previousCorrect
3
previousSSE
0.9375
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
3
SSE
1.1875

Clean cohort: scores omitting 3

reliability_clean_loo_3_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
3
n
5
correct
3
SSE
1.1875
Saved outputs
accuracy
0.6
brier
0.2375

Clean cohort: compare omission 3 endpoints

reliability_clean_loo_3_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
3
accuracy
0.6
brier
0.2375
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Clean cohort: omit 4, retain 0

reliability_clean_loo_4_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Clean cohort: omit 4, retain 1

reliability_clean_loo_4_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Clean cohort: omit 4, retain 2

reliability_clean_loo_4_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
2
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Clean cohort: omit 4, retain 3

reliability_clean_loo_4_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
3
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
0
square
0.5625
Saved outputs
n
4
correct
2
SSE
1.25

Clean cohort: omit 4, retain 5

reliability_clean_loo_4_fold_5

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
4
id
5
previousN
4
previousCorrect
2
previousSSE
1.25
rowCorrect
0
square
0.25
Saved outputs
n
5
correct
2
SSE
1.5

Clean cohort: scores omitting 4

reliability_clean_loo_4_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
4
n
5
correct
2
SSE
1.5
Saved outputs
accuracy
0.4
brier
0.3

Clean cohort: compare omission 4 endpoints

reliability_clean_loo_4_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
4
accuracy
0.4
brier
0.3
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Clean cohort: omit 5, retain 0

reliability_clean_loo_5_fold_0

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
0
previousN
0
previousCorrect
0
previousSSE
0
rowCorrect
1
square
0.0625
Saved outputs
n
1
correct
1
SSE
0.0625

Clean cohort: omit 5, retain 1

reliability_clean_loo_5_fold_1

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
1
previousN
1
previousCorrect
1
previousSSE
0.0625
rowCorrect
1
square
0.0625
Saved outputs
n
2
correct
2
SSE
0.125

Clean cohort: omit 5, retain 2

reliability_clean_loo_5_fold_2

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
2
previousN
2
previousCorrect
2
previousSSE
0.125
rowCorrect
0
square
0.5625
Saved outputs
n
3
correct
2
SSE
0.6875

Clean cohort: omit 5, retain 3

reliability_clean_loo_5_fold_3

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
3
previousN
3
previousCorrect
2
previousSSE
0.6875
rowCorrect
0
square
0.5625
Saved outputs
n
4
correct
2
SSE
1.25

Clean cohort: omit 5, retain 4

reliability_clean_loo_5_fold_4

n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square

A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.

Saved inputs
omittedId
5
id
4
previousN
4
previousCorrect
2
previousSSE
1.25
rowCorrect
1
square
0.25
Saved outputs
n
5
correct
3
SSE
1.5

Clean cohort: scores omitting 5

reliability_clean_loo_5_metrics

accuracy=correct/n; brier=SSE/n

Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.

Saved inputs
omittedId
5
n
5
correct
3
SSE
1.5
Saved outputs
accuracy
0.6
brier
0.3

Clean cohort: compare omission 5 endpoints

reliability_clean_loo_5_select

first candidate initializes all endpoints; later replace only on strict improvement

Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.

Saved inputs
omittedId
5
accuracy
0.6
brier
0.3
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0
Saved outputs
accuracyMin
0.4
accuracyMax
0.6
brierMin
0.2375
brierMax
0.3375
accuracyMinId
0
accuracyMaxId
2
brierMinId
2
brierMaxId
0

Report the whole saved evaluation and its evidence limits

finish

copy defined cohort summaries and descriptive deletion endpoints; omit unavailable metrics

Copy the same complete saved result independently of the selected cursor. Missing clean evidence, empty bins and zero-denominator rates retain their saved reasons. Source frame/tensor counts are not hardware measurements or runtime acceptance.

Saved inputs
fullCount
6
fullCorrect
3
fullTP
2
fullFN
1
fullFP
2
fullTN
1
fullPredictedPositive
4
fullActualPositive
3
fullSSE
1.75
fullMaxAbsoluteResidual
0.75
fullSquareUnderflowCount
0
fullContributionUnderflowCount
0
fullAccuracy
0.5
fullBrier
0.2916666666666667
fullPrecision
0.5
fullRecall
0.6666666666666666
fullCalibrationGap
0.16666666666666666
fullMaxAbsoluteBinGap
0.25
fullAccuracyMin
0.4
fullAccuracyMax
0.6
fullBrierMin
0.2375
fullBrierMax
0.3375
fullAccuracyMinId
0
fullAccuracyMaxId
2
fullBrierMinId
2
fullBrierMaxId
0
cleanCount
6
cleanCorrect
3
cleanTP
2
cleanFN
1
cleanFP
2
cleanTN
1
cleanPredictedPositive
4
cleanActualPositive
3
cleanSSE
1.75
cleanMaxAbsoluteResidual
0.75
cleanSquareUnderflowCount
0
cleanContributionUnderflowCount
0
cleanAccuracy
0.5
cleanBrier
0.2916666666666667
cleanPrecision
0.5
cleanRecall
0.6666666666666666
cleanCalibrationGap
0.16666666666666666
cleanMaxAbsoluteBinGap
0.25
cleanAccuracyMin
0.4
cleanAccuracyMax
0.6
cleanBrierMin
0.2375
cleanBrierMax
0.3375
cleanAccuracyMinId
0
cleanAccuracyMaxId
2
cleanBrierMinId
2
cleanBrierMaxId
0
Saved outputs
fullAccuracy
0.5
fullBrier
0.2916666666666667
cleanAccuracy
0.5
cleanBrier
0.2916666666666667
fullCount
6
fullCorrect
3
fullTP
2
fullFN
1
fullFP
2
fullTN
1
fullPredictedPositive
4
fullActualPositive
3
fullSSE
1.75
fullMaxAbsoluteResidual
0.75
fullSquareUnderflowCount
0
fullContributionUnderflowCount
0
fullPrecision
0.5
fullRecall
0.6666666666666666
fullCalibrationGap
0.16666666666666666
fullMaxAbsoluteBinGap
0.25
fullAccuracyMin
0.4
fullAccuracyMax
0.6
fullBrierMin
0.2375
fullBrierMax
0.3375
fullAccuracyMinId
0
fullAccuracyMaxId
2
fullBrierMinId
2
fullBrierMaxId
0
cleanCount
6
cleanCorrect
3
cleanTP
2
cleanFN
1
cleanFP
2
cleanTN
1
cleanPredictedPositive
4
cleanActualPositive
3
cleanSSE
1.75
cleanMaxAbsoluteResidual
0.75
cleanSquareUnderflowCount
0
cleanContributionUnderflowCount
0
cleanPrecision
0.5
cleanRecall
0.6666666666666666
cleanCalibrationGap
0.16666666666666666
cleanMaxAbsoluteBinGap
0.25
cleanAccuracyMin
0.4
cleanAccuracyMax
0.6
cleanBrierMin
0.2375
cleanBrierMax
0.3375
cleanAccuracyMinId
0
cleanAccuracyMaxId
2
cleanBrierMinId
2
cleanBrierMaxId
0
frames
137
tensorCount
46

Open the house “Inspect all stored values, text metadata and tensor storage” disclosure below for every scalar output and alias, every text field and all policy/column arrays. The compact headline is only a preview; no complete record is truncated.

SOURCE IMPLEMENTATION ONLY. Every import, test, oracle, canonical parity, syntax/type/build, browser, accessibility and offline check is UNRUN under the human FluxGeo hold. Owner source adoption is separate from runtime validation and acceptance. No V3, native witness, timing or reliability certification is claimed.

Inspect all stored values, text metadata and tensor storage

Every scalar output, including flattened operation outputs

Exact text evidence from the same record

These are the stored values, shown without display rounding. Each tensor names its axes, dtype and display precision. Empty arrays are omitted rather than padded.

reliability_Raw

RawField=9 · float64 · precision 8 · Captured raw9 in declared order; m is VALUE, all other cells WORD.

Zero-based storage indexStored value
00.75
10.25
20.75
30.25
40.5
50.5
60.5
70
80

reliability_Labels

Item=6 · int32 · precision 0 · Fixed disclosed rubric labels in original ID order0..5.

Zero-based storage indexStored value
01
10
20
31
41
50

reliability_Rows

Item=6 × RowWordField=7 · float64 · precision 8 · Actual saved baseP,labelOperand,effectiveP,tau,residual,square,absoluteResidual words per original item.

Zero-based storage indexStored value
00.75
11
20.75
30.5
4-0.25
50.0625
60.25
70.25
80
90.25
100.5
110.25
120.0625
130.25
140.75
150
160.75
170.5
180.75
190.5625
200.75
210.25
221
230.25
240.5
25-0.75
260.5625
270.75
280.5
291
300.5
310.5
32-0.5
330.25
340.5
350.5
360
370.5
380.5
390.5
400.25
410.5

reliability_RowDecisions

Item=6 × RowDecisionField=7 · int32 · precision 0 · Actual id,label,exposed,prediction,correct,squareUnderflow,bin VALUE fields per original item.

Zero-based storage indexStored value
00
11
20
31
41
50
61
71
80
90
100
111
120
130
142
150
160
171
180
190
201
213
221
230
240
250
260
270
284
291
300
311
321
330
341
355
360
370
381
390
400
411

reliability_full_MemberIds

CohortItem=6 · int32 · precision 0 · Retained original IDs in ascending order; full0..5 or clean m..5.

Zero-based storage indexStored value
00
11
22
33
44
55

reliability_full_Counts

CountField=10 · int32 · precision 0 · Actual n,correct,TP,FN,FP,TN,predictedPositive,actualPositive,squareUnderflowCount,contributionUnderflowCount VALUE fields.

Zero-based storage indexStored value
06
13
22
31
42
51
64
73
80
90

reliability_full_Statistics

StatisticField=2 · float64 · precision 8 · Actual ordered SSE and maxAbsoluteResidual accumulator words; empty-cohort values are literal +0 initializers, not means.

Zero-based storage indexStored value
01.75
10.75

reliability_full_accuracy

Metric=1 · float64 · precision 8 · Actual saved accuracy division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.5

reliability_full_brier

Metric=1 · float64 · precision 8 · Actual saved brier division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.2916666666666667

reliability_full_precision

Metric=1 · float64 · precision 8 · Actual saved precision division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.5

reliability_full_recall

Metric=1 · float64 · precision 8 · Actual saved recall division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.6666666666666666

reliability_full_bin0_Count

Count=1 · int32 · precision 0 · Actual retained bin count, including a real empty-bin zero.

Zero-based storage indexStored value
02

reliability_full_bin0_Sums

BinSumField=2 · float64 · precision 8 · Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

Zero-based storage indexStored value
00.5
11

reliability_full_bin0_MemberIds

BinItem=2 · int32 · precision 0 · Retained original IDs in this occupied bin, ascending.

Zero-based storage indexStored value
01
13

reliability_full_bin0_Metrics

BinMetricField=6 · float64 · precision 8 · Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

Zero-based storage indexStored value
00.25
10.5
2-0.25
30.25
40.3333333333333333
50.08333333333333333

reliability_full_bin1_Count

Count=1 · int32 · precision 0 · Actual retained bin count, including a real empty-bin zero.

Zero-based storage indexStored value
04

reliability_full_bin1_Sums

BinSumField=2 · float64 · precision 8 · Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

Zero-based storage indexStored value
02.5
12

reliability_full_bin1_MemberIds

BinItem=4 · int32 · precision 0 · Retained original IDs in this occupied bin, ascending.

Zero-based storage indexStored value
00
12
24
35

reliability_full_bin1_Metrics

BinMetricField=6 · float64 · precision 8 · Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

Zero-based storage indexStored value
00.625
10.5
20.125
30.125
40.6666666666666666
50.08333333333333333

reliability_full_Calibration

CalibrationField=2 · float64 · precision 8 · Actual final occupied-bin contribution fold and maximum absolute gap words; no empty-cohort placeholder.

Zero-based storage indexStored value
00.16666666666666666
10.25

reliability_full_OmissionIds

Omission=6 · int32 · precision 0 · All omitted original IDs in ascending order.

Zero-based storage indexStored value
00
11
22
33
44
55

reliability_full_LooScores

Omission=6 × LooScoreField=3 · float64 · precision 8 · Actual fresh retained SSE,accuracy,brier words for each omission, in omission-ID order.

Zero-based storage indexStored value
01.6875
10.4
20.3375
31.6875
40.4
50.3375
61.1875
70.6
80.2375
91.1875
100.6
110.2375
121.5
130.4
140.3
151.5
160.6
170.3

reliability_full_LooCounts

Omission=6 × LooCountField=2 · int32 · precision 0 · Actual retained n,correct integer folds for every omission.

Zero-based storage indexStored value
05
12
25
32
45
53
65
73
85
92
105
113

reliability_full_Endpoints

Endpoint=4 · float64 · precision 8 · Copied actual accuracyMin,accuracyMax,brierMin,brierMax words; descriptive deletion sensitivity only.

Zero-based storage indexStored value
00.4
10.6
20.2375
30.3375

reliability_full_EndpointIds

Endpoint=4 · int32 · precision 0 · First original omission ID attaining each accuracyMin,accuracyMax,brierMin,brierMax endpoint.

Zero-based storage indexStored value
00
12
22
30

reliability_clean_MemberIds

CohortItem=6 · int32 · precision 0 · Retained original IDs in ascending order; full0..5 or clean m..5.

Zero-based storage indexStored value
00
11
22
33
44
55

reliability_clean_Counts

CountField=10 · int32 · precision 0 · Actual n,correct,TP,FN,FP,TN,predictedPositive,actualPositive,squareUnderflowCount,contributionUnderflowCount VALUE fields.

Zero-based storage indexStored value
06
13
22
31
42
51
64
73
80
90

reliability_clean_Statistics

StatisticField=2 · float64 · precision 8 · Actual ordered SSE and maxAbsoluteResidual accumulator words; empty-cohort values are literal +0 initializers, not means.

Zero-based storage indexStored value
01.75
10.75

reliability_clean_accuracy

Metric=1 · float64 · precision 8 · Actual saved accuracy division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.5

reliability_clean_brier

Metric=1 · float64 · precision 8 · Actual saved brier division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.2916666666666667

reliability_clean_precision

Metric=1 · float64 · precision 8 · Actual saved precision division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.5

reliability_clean_recall

Metric=1 · float64 · precision 8 · Actual saved recall division word; this tensor exists only with a positive denominator.

Zero-based storage indexStored value
00.6666666666666666

reliability_clean_bin0_Count

Count=1 · int32 · precision 0 · Actual retained bin count, including a real empty-bin zero.

Zero-based storage indexStored value
02

reliability_clean_bin0_Sums

BinSumField=2 · float64 · precision 8 · Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

Zero-based storage indexStored value
00.5
11

reliability_clean_bin0_MemberIds

BinItem=2 · int32 · precision 0 · Retained original IDs in this occupied bin, ascending.

Zero-based storage indexStored value
01
13

reliability_clean_bin0_Metrics

BinMetricField=6 · float64 · precision 8 · Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

Zero-based storage indexStored value
00.25
10.5
2-0.25
30.25
40.3333333333333333
50.08333333333333333

reliability_clean_bin1_Count

Count=1 · int32 · precision 0 · Actual retained bin count, including a real empty-bin zero.

Zero-based storage indexStored value
04

reliability_clean_bin1_Sums

BinSumField=2 · float64 · precision 8 · Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.

Zero-based storage indexStored value
02.5
12

reliability_clean_bin1_MemberIds

BinItem=4 · int32 · precision 0 · Retained original IDs in this occupied bin, ascending.

Zero-based storage indexStored value
00
12
24
35

reliability_clean_bin1_Metrics

BinMetricField=6 · float64 · precision 8 · Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.

Zero-based storage indexStored value
00.625
10.5
20.125
30.125
40.6666666666666666
50.08333333333333333

reliability_clean_Calibration

CalibrationField=2 · float64 · precision 8 · Actual final occupied-bin contribution fold and maximum absolute gap words; no empty-cohort placeholder.

Zero-based storage indexStored value
00.16666666666666666
10.25

reliability_clean_OmissionIds

Omission=6 · int32 · precision 0 · All omitted original IDs in ascending order.

Zero-based storage indexStored value
00
11
22
33
44
55

reliability_clean_LooScores

Omission=6 × LooScoreField=3 · float64 · precision 8 · Actual fresh retained SSE,accuracy,brier words for each omission, in omission-ID order.

Zero-based storage indexStored value
01.6875
10.4
20.3375
31.6875
40.4
50.3375
61.1875
70.6
80.2375
91.1875
100.6
110.2375
121.5
130.4
140.3
151.5
160.6
170.3

reliability_clean_LooCounts

Omission=6 × LooCountField=2 · int32 · precision 0 · Actual retained n,correct integer folds for every omission.

Zero-based storage indexStored value
05
12
25
32
45
53
65
73
85
92
105
113

reliability_clean_Endpoints

Endpoint=4 · float64 · precision 8 · Copied actual accuracyMin,accuracyMax,brierMin,brierMax words; descriptive deletion sensitivity only.

Zero-based storage indexStored value
00.4
10.6
20.2375
30.3375

reliability_clean_EndpointIds

Endpoint=4 · int32 · precision 0 · First original omission ID attaining each accuracyMin,accuracyMax,brierMin,brierMax endpoint.

Zero-based storage indexStored value
00
12
22
30

Check your understanding

Use the inputs stated in each question. Live questions use the current calculation. Each option pairs a value or conclusion with its mechanism. Editing a raw input, resetting or selecting a trace step clears graded answers; local inspection selectors preserve them.

1. For the disclosed six-item exact-integer rubric, what does the hand-set p0=3/4 mean?
2. Fixed defaults: p=[3/4,1/4,3/4,1/4,1/2,1/2], labels=[1,0,0,1,1,0], tau=1/2,m=0,blend=0. What are ID2’s residual/square and the full one-probability binary Brier mean?
3. Fixed default six forecasts and labels from question2, m=0,blend=0: raise only tau from1/2 to1. Which decision and probability-score statement follows?
4. Current WHOLE saved root, independent of trace selection. Raw9: p0=0.75, p1=0.25, p2=0.75, p3=0.25, p4=0.5, p5=0.5, tau=0.5, m=0, blend=0. Rubric: For every item, the supplied candidate must equal the exact correct integer for the disclosed addition. ID0: prompt 2+2, candidate 4, answer 4; id=0; baseP=0.75; effectiveP=0.75; id=0; label=1; labelOperand=1; effectiveP=0.75; tau=0.5; prediction=1; correct=1; residual=-0.25; square=0.0625; absoluteResidual=0.25; squareUnderflow=0; bin=1. Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD. ID1: prompt 2+3, candidate 6, answer 5; id=1; baseP=0.25; effectiveP=0.25; id=1; label=0; labelOperand=0; effectiveP=0.25; tau=0.5; prediction=0; correct=1; residual=0.25; square=0.0625; absoluteResidual=0.25; squareUnderflow=0; bin=0. Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD. ID2: prompt 3+3, candidate 7, answer 6; id=2; baseP=0.75; effectiveP=0.75; id=2; label=0; labelOperand=0; effectiveP=0.75; tau=0.5; prediction=1; correct=0; residual=0.75; square=0.5625; absoluteResidual=0.75; squareUnderflow=0; bin=1. Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD. ID3: prompt 3+4, candidate 7, answer 7; id=3; baseP=0.25; effectiveP=0.25; id=3; label=1; labelOperand=1; effectiveP=0.25; tau=0.5; prediction=0; correct=0; residual=-0.75; square=0.5625; absoluteResidual=0.75; squareUnderflow=0; bin=0. Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD. ID4: prompt 4+4, candidate 8, answer 8; id=4; baseP=0.5; effectiveP=0.5; id=4; label=1; labelOperand=1; effectiveP=0.5; tau=0.5; prediction=1; correct=1; residual=-0.5; square=0.25; absoluteResidual=0.5; squareUnderflow=0; bin=1. Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD. ID5: prompt 4+5, candidate 10, answer 9; id=5; baseP=0.5; effectiveP=0.5; id=5; label=0; labelOperand=0; effectiveP=0.5; tau=0.5; prediction=1; correct=0; residual=0.5; square=0.25; absoluteResidual=0.5; squareUnderflow=0; bin=1. Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD. FULL original IDs [0, 1, 2, 3, 4, 5]. fullAccuracy=0.5; fullBrier=0.2916666666666667; fullCount=6; fullCorrect=3; fullTP=2; fullFN=1; fullFP=2; fullTN=1; fullPredictedPositive=4; fullActualPositive=3; fullSSE=1.75; fullMaxAbsoluteResidual=0.75; fullSquareUnderflowCount=0; fullContributionUnderflowCount=0; fullPrecision=0.5; fullRecall=0.6666666666666666; fullCalibrationGap=0.16666666666666666; fullMaxAbsoluteBinGap=0.25; fullAccuracyMin=0.4; fullAccuracyMax=0.6; fullBrierMin=0.2375; fullBrierMax=0.3375; fullAccuracyMinId=0; fullAccuracyMaxId=2; fullBrierMinId=2; fullBrierMaxId=0. fullMembershipAvailability: Defined: retained original IDs in ascending order. fullAccuracyAvailability: Defined: correct/n with n>0. fullBrierAvailability: Defined: SSE/n with n>0. fullPrecisionAvailability: Defined: TP/(TP+FP) with predictedPositive>0. fullRecallAvailability: Defined: TP/(TP+FN) with actualPositive>0. fullBin0Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. fullBin1Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. fullCalibrationAvailability: Defined: separately rounded occupied-bin weight/product/fold. fullLooAvailability: Defined: n>=2; fresh folds for every omission and strict first-ID endpoint selection. CLEAN original IDs [0, 1, 2, 3, 4, 5]. cleanAccuracy=0.5; cleanBrier=0.2916666666666667; cleanCount=6; cleanCorrect=3; cleanTP=2; cleanFN=1; cleanFP=2; cleanTN=1; cleanPredictedPositive=4; cleanActualPositive=3; cleanSSE=1.75; cleanMaxAbsoluteResidual=0.75; cleanSquareUnderflowCount=0; cleanContributionUnderflowCount=0; cleanPrecision=0.5; cleanRecall=0.6666666666666666; cleanCalibrationGap=0.16666666666666666; cleanMaxAbsoluteBinGap=0.25; cleanAccuracyMin=0.4; cleanAccuracyMax=0.6; cleanBrierMin=0.2375; cleanBrierMax=0.3375; cleanAccuracyMinId=0; cleanAccuracyMaxId=2; cleanBrierMinId=2; cleanBrierMaxId=0. cleanMembershipAvailability: Defined: retained original IDs in ascending order. cleanAccuracyAvailability: Defined: correct/n with n>0. cleanBrierAvailability: Defined: SSE/n with n>0. cleanPrecisionAvailability: Defined: TP/(TP+FP) with predictedPositive>0. cleanRecallAvailability: Defined: TP/(TP+FN) with actualPositive>0. cleanBin0Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. cleanBin1Availability: Defined: binN>0; both means, signed/absolute gap, weight and contribution exist. cleanCalibrationAvailability: Defined: separately rounded occupied-bin weight/product/fold. cleanLooAvailability: Defined: n>=2; fresh folds for every omission and strict first-ID endpoint selection. Which clean assessment matches this actual record?
5. Fixed counterexample: all six base forecasts1/2, m=0,tau=1/2, labels=[1,0,0,1,1,0]. Also consider the default six-item deletion worksheet and a nonzero tiny residual whose square rounds to zero. Which interpretation is justified?

Exactly five corrective questions follow the saved evidence: vocabulary, a fixed default calculation, a cutoff edit, the current whole clean record, and calibration/deletion/underflow limits.

Read and edit one complete evaluation

The nine labelled number controls appear in capture order. p0 forecasts candidate 4 for 2+2; p1 candidate 6 for 2+3; p2 candidate 7 for 3+3; p3 candidate 7 for 3+4; p4 candidate 8 for 4+4; p5 candidate 10 for 4+5. Each edits that row’s base probability from 0 to 1 with arbitrary numerical steps. tau edits the inclusive decision cutoff from 0 to 1. m is a whole-number exposed-prefix count from 0 to 6: IDs below it are declared exposed. blend, from 0 to 1, controls the deliberate answer-key contribution on those exposed rows. Probabilities, cutoff and blend admit negative zero. Only m uses discrete count semantics. Prompts, candidates, correct answers and labels stay fixed.

At the default, the first four summaries are fullAccuracy, fullBrier, cleanAccuracy and cleanBrier. They describe the whole current saved result. When a metric is unavailable, its numeric field is absent; use the named FULL/CLEAN tables and saved reasons rather than assuming the four headline positions always represent those four metrics. FULL always scores all six rows; CLEAN scores the current unexposed IDs, using the same effective forecasts. With m=0 they describe identical membership.

Try m=4, then blend=1: the full score improves by deliberate answer-key use, while clean IDs4,5 keep their forecasts. Compare blend0 and blend1 at that same m for matched clean membership. Then try m=5 for a singleton or m=6 for empty clean evidence. Reset before changing only tau to1: decisions change, while the probability errors and fixed probability bins do not. The complete manual worksheets below explain each case.

Previous step, Next step and Calculation step replay saved operations for inspection. The cursor changes the selected equation, operands and highlight; it does not change the whole cohort tables or the live clean-evidence question. This is inspection of a completed calculation, with no training or parameter-update history. An edit starts a fresh complete calculation at the first step. Reset example restores all nine defaults, the first step and unanswered questions. Editing, reset and trace navigation clear grades; opening a disclosure preserves them.

A blank, nonfinite or out-of-range draft, or a fractional m such as 1.5, shows an input error. Every draft must be valid before a new numerical state replaces the old one. The retained last valid state stays internal: summaries, saved inputs, trace, computed tables, inspector and questions are withheld until repair or reset. No clamping, integer rounding or partial default merge supplies a substitute. This differs from valid m=6: the full result still exists, with true clean count and sum of squared errors (SSE) equal to zero and specific reasons for absent clean scores.

Read the six-item table, then open All row errors and every executed exposure stage. Continue through FULL and CLEAN counts, metrics, both bins, every valid omission and endpoint owner. All nine current saved inputs, Complete tensor fallback and Complete frame fallback expose the saved raw words, named storage and all operation operands. The house Inspect all stored values, text metadata and tensor storage disclosure includes every output alias and text field. Displayed -0 preserves its saved sign; shortened decimals never decide a threshold tie or feed the next operation. Tables provide captioned, focusable scroll regions in the authored lab source.

This chapter mounts the IV65 lab and displays three complete canonical files below. The worked values are manual derivations; they do not replace evidence from executing the implementation.

First say what is being evaluated

A candidate is the supplied answer. A rubric is the rule used to mark it. Our rule is deliberately narrow: the candidate must equal the exact correct integer for the stated addition. A label yiy_i is 1 when item ii meets this rule and 0 otherwise. The index ii identifies an original row, numbered 0 through 5; it never changes when rows are omitted.

A forecast pip_i is a hand-set probability of label 1. For example, p0=3/4p_0=3/4 forecasts that the supplied answer to item 0 meets the rubric. It is neither a generated-token probability nor a measured fraction of successful LLM responses. An LLM, or large language model, generates language; this evaluator generates no answer, trains nothing and makes no model or API call. An API is a software interface to another service; none is needed here.

Worksheet 1. Six authored items, exact rubric labels and default forecasts.
Original IDPromptSupplied candidateExact answerRubric for this rowLabel yiy_iBase forecast pip_i
02 + 244Candidate equals exact integer answer13/43/4
12 + 365Candidate equals exact integer answer01/41/4
23 + 376Candidate equals exact integer answer03/43/4
33 + 477Candidate equals exact integer answer11/41/4
44 + 488Candidate equals exact integer answer11/21/2
54 + 5109Candidate equals exact integer answer01/21/2

These related questions and their forecasts were authored for teaching. “Test set” names their assessment role here; it does not imply secret examples, representative sampling or separation from an actual training corpus. Leakage means information reserved for assessment influences forecasts or evaluation choices. We will deliberately inject answer-key information, making its source visible rather than trying to detect real memorization.

A cohort is the set of rows a score describes. The full cohort always contains IDs 0–5. The clean cohort contains rows outside a declared exposed prefix. “Clean” means only that declared membership condition; it is no proof of unseen content or independence.

Read the inputs and shapes before the equations

There are nine numerical inputs in order: p0, p1, p2, p3, p4, p5, tau, m, blend. Their defaults are 0.75, 0.25, 0.75, 0.25, 0.5, 0.5, 0.5, 0, 0. The six forecasts, tau and blend lie from 0 through 1, inclusive. The integer m lies from 0 through 6. Row ii is exposed exactly when i<mi<m: m=4 exposes IDs 0,1,2,3. The blend is how strongly we deliberately move an exposed forecast toward its known label. It models a disclosed contamination rule, not a law of model learning.

The Greek letter τ\tau, pronounced tau, names the decision threshold, or cutoff. The effective forecast qiq_i is the forecast after the contamination rule. A scalar is one number, conceptually shape []. Conceptual arrays p,q,yp,q,y each have shape [Item=6]: six aligned item entries. A tensor is an array with named axes. These conceptual shapes explain the mathematics; the actual storage groups several fields together as described next. There is no token, feature, batch or training axis. A confusion table has conceptual shape [ActualLabel=2, PredictedLabel=2]; the bins have a Bin=2 axis. Omitting a row changes a cohort, not the six original identities.

The actual root uses the reliability_ prefix. reliability_Raw has shape [9], axis RawField, in the nine-input order above. reliability_Labels has shape [6], axis Item. reliability_Rows has shape [6,7], axes Item,RowWordField: each original row stores baseP,labelOperand,effectiveP,tau,residual,square,absoluteResidual. reliability_RowDecisions has the same dimensions, axes Item,RowDecisionField, storing id,label,exposed,prediction,correct,squareUnderflow,bin. The field-name arrays are saved text metadata, so the inspector identifies every column.

There is no single stored tensor called Bin with two fabricated metric rows. FULL and CLEAN each have separate bin0 and bin1 Count/Sums tensors, with axes Count and BinSumField; an occupied bin also has MemberIds on BinItem and Metrics on BinMetricField. For example, reliability_clean_bin1_Metrics stores its six saved mean/gap/weight/product values only when that bin is occupied. Cohort members use CohortItem; omissions use Omission, with LooScoreField columns SSE,accuracy,brier. Endpoints use Endpoint, alongside separate original omission IDs. reliability_Exposure exists only for positive m, shape [m,4], axes ExposedItem,ExposureField. Missing cohorts, bins or deletion distributions create no empty tensor or padding score.

float64 names binary64 floating storage; its WORD role means preserving the exact stored bit pattern, including the sign of zero. This covers floating labels, boundaries and copied endpoints. int32 stores discrete integer values; their VALUE role means the exact count or identity, with either zero sign equivalent. The exception inside float64 Raw is index7, m, which has VALUE count semantics. The complete fallback shows each actual tensor’s ID, dimensions, axes, dtype, provenance, declared display precision and every stored cell.

Probabilities and rates are dimensionless fractions. A residual is a signed probability difference. Its square is a squared probability difference, also numerically dimensionless. Counts are numbers of items, never percentages or probability estimates. Book II’s I.8 — Indexed quantities and summation reviews indexed sums; IV.11 — Expectation connects a mean to equal weighting. Here we average a disclosed finite table rather than estimate a population expectation.

One row first: forecast error and a decision

At the default, m=0, so every effective forecast copies its base probability. Item 0 has q0=3/4q_0=3/4 and y0=1y_0=1. Its residual, or signed forecast error, is e0=q0−y0=−1/4e_0=q_0-y_0=-1/4. Multiplying that saved residual by itself gives its squared error s0=(−1/4)(−1/4)=1/16s_0=(-1/4)(-1/4)=1/16. Item 1 instead has residual +1/4+1/4, but the same square. Squaring prevents these opposite errors from canceling before averaging.

A positive decision predicts label 1; a negative decision predicts label 0. Save di=1d_i=1 exactly when the represented qi≥τq_i\ge\tau, and di=0d_i=0 otherwise. Equality belongs to the positive side. A correctness flag cic_i is 1 when di=yid_i=y_i, otherwise 0. With τ=1/2\tau=1/2, item 4 is positive at equality. A forecast of one half is not a claim that the candidate is certainly correct.

The calculation uses binary64, the finite-precision number format used for these operations. Write RN⁡(x)\operatorname{RN}(x) for rounding the exact result of one operation to the nearest representable binary64 number, choosing the even neighbor on an exact tie. Thus the saved residual and square are separately

ei=RN⁡(qi−yi),si=RN⁡(eiei).e_i=\operatorname{RN}(q_i-y_i),\qquad s_i=\operatorname{RN}(e_i e_i).

The floating label operand is positive zero or 1. Decisions compare saved numbers; a shortened displayed decimal never determines a tie. VIII.1 — Floating-point representation and VIII.2 — Rounding and representation error explain representation and rounding.

The complete default row and reduction worksheet

The following dyadic fractions, whose denominators are powers of two, are exactly representable here. The final mean divisions need separate attention. All folds visit retained original IDs in increasing order. A fold means adding one saved value at a time, retaining each partial total, beginning at literal positive zero, written +0+0.

SSE means sum of squared errors. The four confusion counts distinguish true positive (TP: label1, decision1), false negative (FN: label1, decision0), false positive (FP: label0, decision1) and true negative (TN: label0, decision0). With actual-label rows 0,1 and predicted-label columns 0,1, the default confusion table is [[TN,FP],[FN,TP]] = [[1,2],[1,2]]. Each item contributes to exactly one cell.

Worksheet 2. Every default row operation and cumulative count.
IDForecast error qi−yi=eiq_i-y_i=e_iSaved product eiei=sie_i e_i=s_iDecision did_iCorrectness cic_iRow categorySSE after rowCorrect count after rowCumulative TP,FN,FP,TN
03/4−1=−1/43/4-1=-1/4(−1/4)(−1/4)=1/16(-1/4)(-1/4)=1/1611TP+0+1/16=1/16+0+1/16=1/1611,0,0,0
11/4−(+0)=1/41/4-(+0)=1/4(1/4)(1/4)=1/16(1/4)(1/4)=1/1601TN1/16+1/16=1/81/16+1/16=1/821,0,0,1
23/4−(+0)=3/43/4-(+0)=3/4(3/4)(3/4)=9/16(3/4)(3/4)=9/1610FP1/8+9/16=11/161/8+9/16=11/1621,0,1,1
31/4−1=−3/41/4-1=-3/4(−3/4)(−3/4)=9/16(-3/4)(-3/4)=9/1600FN11/16+9/16=5/411/16+9/16=5/421,1,1,1
41/2−1=−1/21/2-1=-1/2(−1/2)(−1/2)=1/4(-1/2)(-1/2)=1/411TP5/4+1/4=3/25/4+1/4=3/232,1,1,1
51/2−(+0)=1/21/2-(+0)=1/2(1/2)(1/2)=1/4(1/2)(1/2)=1/410FP3/2+1/4=7/43/2+1/4=7/432,1,2,1

Let JJ name the retained cohort and nn its item count. For n>0n>0, accuracy is correct decisions divided by all retained items. The binary Brier mean averages the saved squared error of the single probability of label 1. It has no extra factor of two from summing two complementary class probabilities:

accuracy=RN⁡ ⁣(∑i∈Jcin),Brier=RN⁡ ⁣(SSEn).\mathrm{accuracy}=\operatorname{RN}\!\left(\frac{\sum_{i\in J}c_i}{n}\right),\qquad \mathrm{Brier}=\operatorname{RN}\!\left(\frac{\mathrm{SSE}}{n}\right).

The sum sign means the ordered fold just shown, with binary64 rounding at each floating addition. Counts use integer addition starting at 0. At the default, accuracy is 3/6=1/23/6=1/2 and Brier has exact-real target (7/4)/6=7/24(7/4)/6=7/24, approximately 0.291667. The last decimal is a display approximation, not a saved operand. The clean cohort is identical to the full cohort because m=0.

Precision asks what fraction of positive decisions have positive labels: TP/(TP+FP)=2/4=1/2\mathrm{TP}/(\mathrm{TP}+\mathrm{FP})=2/4=1/2. Recall asks what fraction of positive labels receive positive decisions: TP/(TP+FN)=2/3\mathrm{TP}/(\mathrm{TP}+\mathrm{FN})=2/3. Its last division rounds. Precision divides by predicted positives; recall divides by actual positives. Neither is the probability that every future answer will be correct.

Calibration compares groups of forecasts with frequencies

Calibration here compares the average probability in a group with its observed fraction of label-1 items. It is not decision accuracy or the number of printed decimal places. Use two fixed bins: lower [0,1/2)[0,1/2) and upper [1/2,1][1/2,1]. Brackets include an endpoint; the parenthesis excludes it. Zero belongs lower, one half and one belong upper. Bin membership uses the effective forecast, independent of τ\tau.

For each occupied bin bb, let nbn_b mean its item count, PbP_b its ordered probability sum and YbY_b its ordered floating-label sum, both starting at +0+0. Its mean forecast is Pb/nbP_b/n_b and its observed positive fraction is Yb/nbY_b/n_b. Their signed difference is the bin gap; its absolute value gbg_b removes direction. The weight wb=nb/nw_b=n_b/n is the fraction of the cohort in that bin. The contribution vb=wbgbv_b=w_b g_b measures its weighted absolute gap. Compute each division, subtraction and multiplication as a separate RN operation, then fold occupied contributions in lower/upper order from +0+0. Call that descriptive aggregate EE.

Worksheet 3. Both fixed bins and the separate weight/product/fold graph.
BinIDsPbP_b partials from +0+0YbY_b partials from +0+0Bin count nbn_bMean forecastObserved fractionSigned gap; gbg_bRounded weight; contribution
Lower1,31/4,1/21/4,1/2+0,1+0,12(1/2)/2=1/4(1/2)/2=1/41/21/2−1/4;1/4-1/4;1/4wL=RN⁡(2/6)w_L=\operatorname{RN}(2/6); vL=RN⁡(wL/4)v_L=\operatorname{RN}(w_L/4)
Upper0,2,4,53/4,3/2,2,5/23/4,3/2,2,5/21,1,2,21,1,2,24(5/2)/4=5/8(5/2)/4=5/82/4=1/22/4=1/21/8;1/81/8;1/8wU=RN⁡(4/6)w_U=\operatorname{RN}(4/6); vU=RN⁡(wU/8)v_U=\operatorname{RN}(w_U/8)

The exact-real weighted expression is (2/6)(1/4)+(4/6)(1/8)=1/6(2/6)(1/4)+(4/6)(1/8)=1/6. To show the actual rounding order manually, let K=6004799503160661K=6004799503160661, an integer used only to spell these representable fractions. Then wL=K/254w_L=K/2^{54} and wU=K/253w_U=K/2^{53}: the nearest binary64 approximations to one third and two thirds. Scaling them by 1/41/4 and 1/81/8 is exact here, so both saved contributions equal K/256K/2^{56}. The aggregate fold is +0→K/256→K/255+0\to K/2^{56}\to K/2^{55}, whose usual short decimal is 0.16666666666666666. This is a manual representation derivation, not program output. It preserves the separate weight, product and addition stages; it gives no general license to replace them with a rearranged real formula. The maximum absolute bin gap is 1/41/4 and neither default contribution underflows.

An empty bin has a real count and sum of zero, but no mean, label fraction, gap, weight or contribution. There is no observation to average and no need to evaluate zero times an undefined gap. Its term is absent from the aggregate with a reason.

Fresh leave-one-out folds: what one deletion changes

Leave-one-out here means omitting each retained item once and scoring the others with the same saved forecasts, labels, threshold and decisions. It does not retrain or recalibrate anything. It describes sensitivity to deleting one of these particular items. Enumerate omitted IDs in increasing order. For each one, start a fresh +0+0 squared-error fold over the remaining IDs; never subtract a row from a rounded full total. The divisor is now n−1n-1, the number actually retained.

Why insist on a fresh fold? Consider the manual case m=0, with forecasts 0,2−27,0,1,1,00,2^{-27},0,1,1,0 and the same fixed labels. ID0 contributes square1; ID1 contributes 2−542^{-54}; the other squares are0. Adding that tiny term to1 rounds back to1 in binary64. Subtracting the omitted ID0 square from that rounded total would give0. A fresh omit0 fold instead retains 2−542^{-54}, and its Brier division by5 remains positive. This is a rounding/cancellation counterexample, not the within-bin statistical cancellation discussed later and not a runtime observation.

Worksheet 4. All six omissions with fresh retained-row folds.
Omitted IDRetained IDs in fold orderSSE partials, each starting after +0+0Correct-count partials from 0AccuracyExact-real Brier target
01,2,3,4,51/16,10/16,19/16,23/16,27/161/16,10/16,19/16,23/16,27/161,1,1,2,22/52/5(27/16)/5=27/80(27/16)/5=27/80
10,2,3,4,51/16,10/16,19/16,23/16,27/161/16,10/16,19/16,23/16,27/161,1,1,2,22/52/5(27/16)/5=27/80(27/16)/5=27/80
20,1,3,4,51/16,2/16,11/16,15/16,19/161/16,2/16,11/16,15/16,19/161,2,2,3,33/53/5(19/16)/5=19/80(19/16)/5=19/80
30,1,2,4,51/16,2/16,11/16,15/16,19/161/16,2/16,11/16,15/16,19/161,2,2,3,33/53/5(19/16)/5=19/80(19/16)/5=19/80
40,1,2,3,51/16,2/16,11/16,20/16,24/161/16,2/16,11/16,20/16,24/161,2,2,2,22/52/5(24/16)/5=3/10(24/16)/5=3/10
50,1,2,3,41/16,2/16,11/16,20/16,24/161/16,2/16,11/16,20/16,24/161,2,2,2,33/53/5(24/16)/5=3/10(24/16)/5=3/10

Each successive fraction adds the next retained row’s saved square from the six-row table. The dyadic numerators are exact here; each final division is rounded independently. Only after recording all omissions select the minimum and maximum saved values. Accuracy spans [2/5,3/5][2/5,3/5], with first minimum at omission0 and first maximum at omission2. Brier spans [19/80,27/80][19/80,27/80], with first minimum at omission2 and first maximum at omission0. Equal endpoint values keep the first, lowest original omission ID. Endpoints copy the saved omission values rather than recomputing them for display.

A confidence interval needs a specified statistical target and coverage assumptions: for example, a claim about how often a repeated sampling procedure covers a population quantity. None is supplied here. IID means independent observations from the same distribution. These related, curated sums are not claimed IID, and these ranges are not confidence or credible intervals, sampling variance, coverage probabilities or guarantees about new tasks. A narrow range may simply describe a narrow or contaminated table.

Deliberate answer-key contamination

For an exposed row only, first subtract its base forecast from the floating label, multiply that saved difference by the blend, then add that saved product to the base:

δi=RN⁡(yi−pi),ti=RN⁡(blend δi),qi=RN⁡(pi+ti).\delta_i=\operatorname{RN}(y_i-p_i),\qquad t_i=\operatorname{RN}(\mathrm{blend}\,\delta_i),\qquad q_i=\operatorname{RN}(p_i+t_i).

Here δi\delta_i names the label-directed difference, and tit_i is the taint contribution, unrelated to the threshold τ\tau. An unexposed row instead copies pip_i exactly. Those three operations do not run for it; their absence needs a reason rather than fabricated zero operands. Even blend0 does not permit skipping the three operations on an exposed row.

Keep all default probabilities and τ=1/2\tau=1/2, but set m=4, blend=1:

Worksheet 5. Four exposed rows, two unchanged clean rows and every branch result.
IDExposed?Saved difference δi\delta_iSaved product tit_iAddition or copy giving qiq_iResidual; squareDecision; correct
0Yes1−3/4=1/41-3/4=1/41(1/4)=1/41(1/4)=1/43/4+1/4=13/4+1/4=1+0;+0+0;+01;1
1Yes+0−1/4=−1/4+0-1/4=-1/41(−1/4)=−1/41(-1/4)=-1/41/4−1/4=+01/4-1/4=+0+0;+0+0;+00;1
2Yes+0−3/4=−3/4+0-3/4=-3/41(−3/4)=−3/41(-3/4)=-3/43/4−3/4=+03/4-3/4=+0+0;+0+0;+00;1
3Yes1−1/4=3/41-1/4=3/41(3/4)=3/41(3/4)=3/41/4+3/4=11/4+3/4=1+0;+0+0;+01;1
4NoAbsent: unexposedAbsent: unexposedCopy 1/21/2−1/2;1/4-1/2;1/41;1
5NoAbsent: unexposedAbsent: unexposedCopy 1/21/21/2;1/41/2;1/41;0

The full SSE fold is +0→+0→+0→+0→+0→1/4→1/2+0\to+0\to+0\to+0\to+0\to1/4\to1/2, and correct-count partials are 1,2,3,4,5,5. Full counts are TP3,FN0,FP1,TN2: accuracy 5/65/6, Brier (1/2)/6=1/12(1/2)/6=1/12, precision 3/43/4, recall1. The higher score was constructed by using labels. It supplies no new observed ability.

For this state the lower bin contains IDs1,2, with probability and label sums both zero and count2. The upper bin contains IDs0,3,4,5: probability partials 1,2,5/2,31,2,5/2,3 and label partials 1,2,3,31,2,3,3, count4. Their two means both equal 3/43/4. Both occupied bin gaps and contributions are zero, so E=0E=0 even though ID5 is wrong. The full Brier is also still positive.

Hold the clean comparison fixed

Compare blend0 and blend1 with m=4 in both cases. The clean cohort is always IDs4,5; both forecasts stay 1/21/2, with residuals −1/2,+1/2-1/2,+1/2 and squares 1/4,1/41/4,1/4. Its fresh SSE partials are 1/4,1/21/4,1/2 and correctness partials1,1. Thus clean accuracy remains 1/21/2, Brier remains 1/41/4, precision is 1/21/2, recall1, and confusion counts TP1,FN0,FP1,TN0. Its only occupied bin is upper, with probability partials 1/2,11/2,1 and label partials1,1: both means are 1/21/2 and its gap is zero. The lower bin has no means. This matched comparison holds membership and inputs fixed; the full-to-clean difference changes the denominator and membership too.

For full contaminated leave-one-out, omissions0–3 each leave SSE 1/21/2 and four correct decisions out of five, giving Brier 1/101/10 and accuracy 4/54/5. Omission4 leaves SSE 1/41/4, four correct out of five, giving 1/201/20 and 4/54/5. Omission5 leaves SSE 1/41/4, five correct out of five, giving 1/201/20 and1. All are fresh folds over retained IDs. Full ranges are accuracy [4/5,1][4/5,1], Brier [1/20,1/10][1/20,1/10]. For clean IDs4,5, omitting4 leaves incorrect ID5: accuracy0, Brier 1/41/4; omitting5 leaves correct ID4: accuracy1, Brier 1/41/4. Its accuracy range is [0,1][0,1] despite a zero-width Brier range. The two summaries describe different aspects of the same evidence.

Membership alone can move a score

Restore default forecasts and threshold; set m=2, blend=0. With these ordinary positive inputs the forecasts remain the defaults. Yet clean IDs2,3,4,5 contain correctness flags0,0,1,0. Their squares fold from +0+0 through 9/16,18/16,22/16,26/16=13/89/16,18/16,22/16,26/16=13/8. Clean accuracy is 1/41/4 and Brier (13/8)/4=13/32(13/8)/4=13/32, while the unchanged full scores are 1/21/2 and 7/247/24. Removing rows selected a harder subset. It did not demonstrate the causal effect of contamination or a change in learned parameters.

Missing denominators are evidence, too

A zero numerator with a positive denominator gives a defined zero. A zero denominator supplies no ratio. Preserve each actual count and sum, omit each unavailable numerical metric, and state its specific reason. Do not insert an epsilon, zero, null, infinity or a made-up perfect result.

The saved availability text distinguishes these cases precisely:

  • Accuracy and Brier require positive retained count n; at n=0 each has no denominator.
  • Precision requires TP+FP>0; otherwise there are no predicted positives. Recall requires TP+FN>0; otherwise there are no actual positives.
  • A bin with binN=0 omits member storage, means, observed fraction, signed/absolute gap, weight and contribution; no aggregate term executes.
  • Calibration and its reported maximum bin gap require n>0; empty-cohort fold initializers do not supply those metrics.
  • Leave-one-out at n=0 has no items to omit; at n=1 deletion leaves no scoring items. These are different saved reasons, and neither has endpoints.

With m=5, the only clean item is negative ID5. At default probabilities and threshold it is predicted positive: FP1, TP0, FN0, TN0. Clean accuracy is 0/1=00/1=0, Brier (1/4)/1=1/4(1/4)/1=1/4, and precision 0/1=00/1=0 is defined. Recall is absent because actual-positive count is zero. The lower bin is empty. The upper singleton has mean forecast 1/21/2, observed fraction0, gap 1/21/2, weight1 and contribution 1/21/2. Deleting this sole item leaves nothing, so no leave-one-out distribution or range exists.

With m=6, clean count is0 and all its confusion counts and SSE are truly zero; clean accuracy, Brier, precision, recall, calibration aggregate and deletion endpoints are absent. All bins are empty. With blend1 and the default bases, the six full forecasts equal their labels and give full accuracy1 and Brier0 by construction. Those available full scores cannot fill the missing clean evidence or establish reliability.

Move a threshold without changing a forecast

Restore m=0 and all default probabilities. At τ=0\tau=0, all six decisions are positive, including a forecast exactly zero if one is entered. Counts become TP3,FN0,FP3,TN0; accuracy 1/21/2, precision 1/21/2, recall1. At τ=1\tau=1, no default forecast reaches1, so all decisions are negative: TP0,FN3,FP0,TN3; accuracy 1/21/2, precision absent because no positives were predicted, recall 0/3=00/3=0. A forecast exactly1 would still be positive at τ=1\tau=1.

Neither edit changes any forecast, residual, square, Brier, probability-bin membership or calibration value. A threshold changes the decision rule; it does not recalibrate probabilities. Exact ties use saved represented values, with no tolerance band or display rounding.

Two calibration counterexamples

Set every base forecast to 1/21/2, keep m=0, tau=1/2. All decisions are positive, so TP3,FP3,FN0,TN0 and accuracy 1/21/2. Every residual has magnitude 1/21/2, every square is 1/41/4, and the SSE partials are 1/4,1/2,3/4,1,5/4,3/21/4,1/2,3/4,1,5/4,3/2. Brier is 1/41/4. All rows enter the upper bin: probability partials 1/2,1,3/2,2,5/2,31/2,1,3/2,2,5/2,3 and label partials1,1,1,2,3,3 give identical means 1/21/2. Its gap and contribution are zero, yet three decisions are wrong. Lower-bin means are absent, not perfect zero estimates.

Now set every probability to 3/43/4 instead. The decisions and accuracy stay the same. The residuals for positive labels are −1/4-1/4 and for negative labels 3/43/4; squares are respectively 1/161/16 and 9/169/16. In original order the SSE partials are 1/16,10/16,19/16,20/16,21/16,30/161/16,10/16,19/16,20/16,21/16,30/16. Dividing by6 gives Brier 5/165/16. The sole occupied upper bin has mean forecast 3/43/4, observed fraction 1/21/2, gap 1/41/4 and weight1, so E=1/4E=1/4. Equal accuracy can conceal different probability errors and grouped gaps. Conversely, zero grouped gap can conceal wrong decisions: opposite row errors cancel inside a bin. This statistical grouping effect differs from numerical rounding cancellation.

Very small numbers and signed zero

Binary64 has positive and negative zero. A word means the stored bit pattern; an exact copy of a raw probability preserves its word, including -0. Counts and row identities describe discrete values, where the zero signs are equivalent. An unexposed base -0 is copied as -0. For an exposed negative-label row with base -0 and blend +0, the difference (+0)−(−0)(+0)-(-0) is +0+0, the product is +0+0, and adding it to the base gives +0+0. Zero blend therefore does not universally preserve the exposed base word. This is why the three operations are retained even at endpoints. In the actual controls, reset, enter p1=-0, and compare m=0 with m=2, blend=+0: the unexposed copy preserves effective/residual -0, while the exposed addition ends effective +0. At the same exposed state, entering blend=-0 instead gives taint -0 and effective -0 from (−0)+(−0)(-0)+(-0). The raw/base word stays -0 in both exposure cases. These are manual word derivations to inspect in the saved row/exposure evidence, with no claim of observed browser or runtime behavior.

A subnormal is a representable number in binary64’s smallest-magnitude range. On an unexposed negative-label row, choose the smallest positive subnormal a=2−1074a=2^{-1074}. The residual is nonzero aa, but its exact square 2−21482^{-2148} is smaller than half the smallest positive representable value; the saved product rounds to +0+0. This is underflow. Rounded squared error0 therefore does not prove exact forecast identity. Retain the nonzero residual, maximum absolute residual and squared-underflow indicator/count alongside the Brier value. A zero aggregate alone does not show which items matched exactly.

Calibration likewise retains its maximum absolute bin gap and any contribution rounded from a nonzero gap to zero, rather than promoting a rounded aggregate0 to exact absence of gaps. These are numerical disclosure obligations, not numerical measurements from a run. VIII.5 — Overflow and underflow explains underflow; III-39’s different local examples do not override this chapter’s explicit allowance for finite squared underflow.

All raw fields require validation, even if an exposure rule might override a forecast. Require the complete nine-field ordinary or null-prototype data record. Acquire every own-field descriptor before inspecting any descriptor; inspect them all before any finite-number check, finish every finite check before raw-order domain checks, and check the helper’s operation-name prefix last. That prefix is ASCII text used to name saved operations, not another probability control. A data descriptor stores a value; an accessor runs code to obtain one and is not an admitted field. Reject missing, inherited, extra, symbol or accessor fields, unsupported containers, strings, booleans, nonfinite numbers and invalid ranges without coercion, clamping or default merging. For example, a finite out-of-range p0=2 together with a nonfinite p5 fails the finite stage before the domain stage. Invalid input supplies no successful assessment. A mathematically absent clean recall in an otherwise valid record is a different case.

What these scores leave unknown

Reliability concerns dependable behavior under stated tasks and conditions. We have computed a chosen rule on supplied candidates and authored forecasts. There is no generated text, training, measured model accuracy, sampling experiment, external numerical measurement, IID evidence, causal reliability estimate or confidence-interval claim. An overlap flag is not a memorization detector. A clean subset can omit important tasks and still share information with exposed examples. No chosen decimal precision repairs those design limitations.

If probabilities, cutoffs, bins or membership are selected after inspecting scores, the evaluation has informed those choices. III-35’s separation between selection data and final assessment applies even when every formula is correct. III-39 adds a different requirement: the full data, choices and operation order must be reproducible. Reproducibility can reproduce a biased or contaminated experiment. Neither exact arithmetic nor a full trace makes a narrow rubric representative of real LLM use.

Follow the complete Python sources

These three panels import the entire actual files directly, in dependency order: generic support, evaluation helper, then chapter entry. The support file also contains its original decoder teaching task; IV65 reaches only its generic fault, immutable-copy, ASCII-prefix, trace and ordinary indexed NumPy storage facilities. Displaying the full file does not mean this evaluator runs the decoder, attention, native elementary functions or old checks.

In evaluation_reference.py, reliability_state captures every raw field before domain decisions. _first computes the exposure subtraction/product/addition separately, stores all six effective probabilities through _storage, and reads all six actual indexed values before decisions, residuals or reductions. _fold supplies ascending-ID counts/SSE, _bins supplies separately rounded means/weight/product/fold, and _leave_one_out starts fresh for every omission. _project copies this complete saved evidence into public frames, tensors and texts; it does not recompute floating scores. Callbacks occur after private capture, so the saved record represents the calculation rather than physically intercepting its instructions.

The entry iv65.py supplies derive_iv65, setup/finish frames, ordered summaries and aliases, strict JSON admission and a command-line boundary. Its ordinary input selects defaults or a complete replacement record, never a partial merge. Explicit source self-checks are separate opt-in owner work; none is run here. Cross-language word parity, parser/loader behavior and all numerical/check source remain unvalidated. The panels always include the underlying files in full, including later source edits; their presence alone does not certify a final canonical review.

1. Generic support: decoder_reference.py

Read the complete executable Python / NumPy source

This is the actual reference file, imported directly from the repository. Comments explain each operation. It is provided for later execution; no validation run is claimed.

"""Independent IV59 scalar FIRST, with owner-adopted public bindings.

All execution and checks are UNRUN. Saved scalar captures drive serialization.
NumPy is used only for explicitly indexed result storage, never contractions.
"""
import math
import re
from types import MappingProxyType

import numpy as np


class NumericalFault(Exception):
    def __init__(self, code, reason):
        super().__init__(reason)
        self.code = code
        self.reason = reason


class _FrozenDict(dict):
    def _readonly(self, *args, **kwargs):
        raise TypeError("Frozen trace record.")
    __setitem__ = __delitem__ = clear = pop = popitem = setdefault = update = __ior__ = _readonly


class _FrozenList(list):
    def _readonly(self, *args, **kwargs):
        raise TypeError("Frozen trace array.")
    __setitem__ = __delitem__ = append = clear = extend = insert = pop = remove = reverse = sort = __iadd__ = __imul__ = _readonly


def _freeze(value):
    if type(value) in (dict, _FrozenDict):
        return _FrozenDict({key: _freeze(child) for key, child in value.items()})
    if type(value) in (list, tuple, _FrozenList):
        return _FrozenList(_freeze(child) for child in value)
    if value is None or type(value) in (str, bool, int, float):
        if type(value) is float and not math.isfinite(value):
            raise TypeError("Trace values must be finite, plain JSON data.")
        return value
    raise TypeError("Copy typed arrays to plain arrays before tracing.")



DEFAULT_IV59 = _freeze(dict(
    token0=97, token1=97, positionScale=0.5,
    q1=1.0, k1=1.0, v1=1.0, o1=0.5, f1=0.5,
    q2=1.0, k2=0.5, v2=1.0, o2=0.25, f2=0.25,
    biasA=0.0, biasB=0.0, biasEOS=0.0))
_FIELDS = tuple(DEFAULT_IV59)
_GAIN_FIELDS = ("q", "k", "v", "o", "f")
_IDS = (97, 98, 512)


def _finite(value, name):
    if not math.isfinite(value):
        raise NumericalFault("NONFINITE", name + " must be finite.")
    return value


def _capture_record(value, fields, label):
    # Exact built-ins exclude custom reflection/getitem/accessor side effects.
    if type(value) not in (dict, _FrozenDict):
        raise NumericalFault("INVALID_INPUT", label + " must be a plain object.")
    keys = tuple(value)
    if len(keys) != len(fields) or any(type(key) is not str for key in keys) or set(keys) != set(fields):
        raise NumericalFault("INVALID_INPUT", label + " must have exactly " + ", ".join(fields) + " as own fields.")
    captured = {key: value[key] for key in fields}
    for key in fields:
        item = captured[key]
        if type(item) not in (int, float) or (type(item) is float and not math.isfinite(item)):
            raise NumericalFault("NONFINITE", label + "." + key + " must be an actual finite number.")
    return captured


def decoder_state(value):
    """Capture raw16 once; check every number before any domain or conversion."""
    captured = _capture_record(value, _FIELDS, "state")
    for key in _FIELDS:
        item = captured[key]
        if key in ("token0", "token1"):
            if item not in _IDS or (type(item) is float and not item.is_integer()):
                raise NumericalFault("INVALID_INPUT", key + " must be an integer token ID in {97,98,512}.")
        else:
            lower, upper = ((0, 1) if key == "positionScale" else
                            (-2, 2) if key.startswith("bias") else (-1, 1))
            if not lower <= item <= upper:
                raise NumericalFault("INVALID_INPUT", f"{key} must be between {lower} and {upper}.")
    return _freeze({key: int(captured[key]) if key in ("token0", "token1") else float(captured[key])
                    for key in _FIELDS})


def _block_inputs(features, gains, prefix):
    if type(features) not in (list, _FrozenList):
        raise NumericalFault("INVALID_INPUT", "features must be an ordinary dense array.")
    if len(features) not in (2, 4, 6):
        raise NumericalFault("INVALID_INPUT", "features must contain 2, 4 or 6 words for B=1,T=1..3,D=2.")
    captured = list(features)
    for i, item in enumerate(captured):
        if type(item) not in (int, float) or (type(item) is float and not math.isfinite(item)):
            raise NumericalFault("NONFINITE", f"features[{i}] must be an actual finite number.")
    for i, item in enumerate(captured):
        if not -16 <= item <= 16:
            raise NumericalFault("INVALID_INPUT", f"features[{i}] must be between -16 and 16.")
    captured_gains = _capture_record(gains, _GAIN_FIELDS, "gains")
    for key in _GAIN_FIELDS:
        if not -1 <= captured_gains[key] <= 1:
            raise NumericalFault("INVALID_INPUT", f"gains.{key} must be between -1 and 1.")
    _prefix(prefix)
    return [float(item) for item in captured], {key: float(captured_gains[key]) for key in _GAIN_FIELDS}


def _prefix(prefix):
    if type(prefix) is not str or re.fullmatch(r"[A-Za-z][A-Za-z0-9_]*", prefix) is None:
        raise NumericalFault("INVALID_INPUT", "prefix must start with an ASCII letter and contain only ASCII letters, digits or underscores.")


class _MechanismTrace:
    """Private captures; labels and schema are NOT the public adopted inventory."""
    def __init__(self):
        self.steps = []
        self.native = []
        self._ids = set()

    def add(self, identifier, inputs, outputs):
        if type(identifier) is not str or not identifier or identifier in self._ids:
            raise NumericalFault("INVALID_INPUT", "Trace IDs must be nonempty and unique.")
        before, after = dict(inputs), dict(outputs)
        for record in (before, after):
            for key, value in record.items():
                if type(key) is not str or type(value) not in (int, float):
                    raise NumericalFault("INVALID_INPUT", "Capture scalar data only.")
                _finite(value, identifier + "/" + key)
        if len(self.steps) >= 512:
            raise NumericalFault("UNSUPPORTED_SIZE", "At most 512 operations are supported.")
        self._ids.add(identifier)
        self.steps.append((identifier, MappingProxyType(before), MappingProxyType(after)))

    def leaf(self, identifier, kind, argument):
        _finite(argument, identifier + " argument")
        lower, upper = (0.25, 4096.0) if kind == "sqrt" else (-256.0, 0.0)
        if not lower <= argument <= upper:
            raise NumericalFault("INVALID_INPUT", "Native argument outside authored scope.")
        if any(record["id"] == identifier for record in self.native):
            raise NumericalFault("INVALID_INPUT", "Native capture ID must be unique.")
        output = _finite(math.sqrt(argument) if kind == "sqrt" else math.exp(argument), identifier)
        if output <= 0:
            raise NumericalFault("NONFINITE", "Native result must be positive.")
        self.native.append(MappingProxyType(dict(id=identifier, kind=kind, input=argument, output=output)))
        return output


def decoder_trace():
    """Create the adopted collector, with no implicit self-check."""
    return _PublicTrace()


def _norm(features, trace, prefix):
    result = []
    for t in range(len(features) // 2):
        x0, x1 = features[2 * t:2 * t + 2]
        total = _finite(x0 + x1, "feature sum")
        mean = _finite(total / 2.0, "feature mean")
        centered0, centered1 = _finite(x0 - mean, "centered0"), _finite(x1 - mean, "centered1")
        square0, square1 = _finite(centered0 * centered0, "square0"), _finite(centered1 * centered1, "square1")
        square_sum = _finite(square0 + square1, "square sum")
        variance = _finite(square_sum / 2.0, "population variance")
        argument = _finite(variance + 0.25, "variance plus epsilon")
        denominator = trace.leaf(f"{prefix}_{t}_sqrt", "sqrt", argument)
        trace.add(f"{prefix}_{t}_statistics", dict(x0=x0, x1=x1, epsilon=0.25),
                  dict(sum=total, mean=mean, centered0=centered0, centered1=centered1,
                       square0=square0, square1=square1, squareSum=square_sum,
                       variance=variance, variancePlusEpsilon=argument, denominator=denominator))
        for d, source in enumerate((centered0, centered1)):
            normalized = _finite(source / denominator, "normalized")
            scaled = _finite(1.0 * normalized, "gamma times normalized")
            value = _finite(scaled + 0.0, "plus beta")
            result.append(value)
            trace.add(f"{prefix}_{t}_feature_{d}", dict(source=source, denominator=denominator, gamma=1.0, beta=0.0),
                      dict(normalized=normalized, scaled=scaled, value=value))
    return result


def _two_products(features, weights, trace, prefix, bias=None, cols=2):
    result = []
    for t in range(len(features) // 2):
        x0, x1 = features[2 * t:2 * t + 2]
        for d in range(cols):
            w0, w1 = weights[d], weights[cols + d]
            product0, product1 = _finite(x0 * w0, "product0"), _finite(x1 * w1, "product1")
            total = _finite(product0 + product1, "two product sum")
            outputs = dict(product0=product0, product1=product1, sum=total)
            inputs = dict(x0=x0, x1=x1, w0=w0, w1=w1)
            value = total
            if bias is not None:
                inputs["bias"] = bias[d]
                value = _finite(total + bias[d], "bias last")
            outputs["value"] = value
            trace.add(f"{prefix}_{t}_{d}", inputs, outputs)
            result.append(value)
    return result


def _softmax(logits, allowed, trace, prefix, positive_zero=True):
    candidates = [value for value, keep in zip(logits, allowed) if keep]
    maximum = candidates[0]
    for value in candidates[1:]:
        # Match Math.max's +0 preference; the shifted native argument keeps sign.
        if value > maximum or (positive_zero and value == 0.0 and maximum == 0.0 and math.copysign(1.0, value) > 0.0):
            maximum = value
    terms = []
    shifted = {}
    denominator = 0.0
    running = []
    for j, (value, keep) in enumerate(zip(logits, allowed)):
        term = 0.0
        if keep:
            argument = _finite(value - maximum, "allowed shifted logit")
            shifted[f"shifted{j}"] = argument
            term = trace.leaf(f"{prefix}_exp_{j}", "exp", argument)
        terms.append(term)
    for term in terms:
        denominator = _finite(denominator + term, "softmax ordered denominator")
        running.append(denominator)
    probabilities = [_finite(term / denominator, "probability") for term in terms]
    inputs = {f"logit{j}": value for j, value in enumerate(logits)}
    inputs.update({f"allowed{j}": int(keep) for j, keep in enumerate(allowed)})
    outputs = dict(max=maximum, denominator=denominator, **shifted)
    outputs.update({f"term{j}": term for j, term in enumerate(terms)})
    outputs.update({f"p{j}": probability for j, probability in enumerate(probabilities)})
    outputs.update({f"running{j}": value for j, value in enumerate(running)})
    trace.add(prefix, inputs, outputs)
    return probabilities


def _accumulate_rows(features, width, weights, cols, trace, prefix, bias=None):
    result = []
    for t in range(len(features) // width):
        for d in range(cols):
            running = 0.0
            inputs, outputs = {}, {}
            for k in range(width):
                value, weight = features[t * width + k], weights[k * cols + d]
                inputs[f"x{k}"], inputs[f"w{k}"] = value, weight
                product = _finite(value * weight, "ordered product")
                running = _finite(running + product, "ordered running sum")
                outputs[f"product{k}"], outputs[f"running{k}"] = product, running
            value = running
            if bias is not None:
                inputs["bias"] = bias[d]
                value = _finite(running + bias[d], "output bias last")
            outputs["value"] = value
            trace.add(f"{prefix}_{t}_{d}", inputs, outputs)
            result.append(value)
    return result


def _residual(left, right, trace, prefix):
    result = []
    for i in range(len(left)):
        value = _finite(left[i] + right[i], "residual")
        trace.add(f"{prefix}_{i}", dict(left=left[i], right=right[i]), dict(value=value))
        result.append(value)
    return result


def _storage(values, rows, cols):
    """No numerical NumPy operation: store already computed Python scalars."""
    stored = np.empty((1, rows, cols), dtype=np.float64)
    for t in range(rows):
        for d in range(cols):
            stored[0, t, d] = values[t * cols + d]
    return stored


def _decoder_block_mechanics(features, gains, trace, prefix):
    """Original independent scalar graph; public metadata is a copy projection."""
    count = len(features) // 2
    norm1 = _norm(features, trace, prefix + "_ln1")
    matrices = {key: [gains[key], 0.0, 0.0, gains[key]] for key in ("q", "k", "v", "o")}
    q = _two_products(norm1, matrices["q"], trace, prefix + "_Q")
    k = _two_products(norm1, matrices["k"], trace, prefix + "_K")
    v = _two_products(norm1, matrices["v"], trace, prefix + "_V")
    # H=1 split is still an actual copy with an explicit coordinate capture.
    heads = []
    for label, source in (("Q", q), ("K", k), ("V", v)):
        copied = []
        for i, value in enumerate(source):
            copied.append(value)
            trace.add(f"{prefix}_{label}_split_{i}", dict(source=value), dict(value=value))
        heads.append(copied)
    q, k, v = heads
    divisor = trace.leaf(prefix + "_attention_sqrt", "sqrt", 2.0)
    raw, scores, logits, allowed = [], [], [], []
    for i in range(count):
        for j in range(count):
            product0 = _finite(q[2 * i] * k[2 * j], "score product0")
            product1 = _finite(q[2 * i + 1] * k[2 * j + 1], "score product1")
            dot = _finite(product0 + product1, "raw score")
            score = _finite(dot / divisor, "scaled score")
            raw.append(dot)
            scores.append(score)
            trace.add(f"{prefix}_score_{i}_{j}", dict(q0=q[2*i], q1=q[2*i+1], k0=k[2*j], k1=k[2*j+1], divisor=divisor),
                      dict(product0=product0, product1=product1, raw=dot, score=score))
    probabilities = []
    for i in range(count):
        row, mask = [], []
        for j in range(count):
            row.append(_finite(scores[i * count + j] + 0.0, "score plus zero common shift"))
            mask.append(j <= i)
        logits.extend(row)
        allowed.extend(mask)
        probabilities.extend(_softmax(row, mask, trace, f"{prefix}_attention_row_{i}"))
    mixed = []
    for i in range(count):
        for d in range(2):
            running = 0.0
            inputs, outputs = {}, {}
            for j in range(count):
                probability, value = probabilities[i * count + j], v[2 * j + d]
                inputs[f"p{j}"], inputs[f"v{j}"] = probability, value
                product = _finite(probability * value, "including forbidden zero product")
                running = _finite(running + product, "attention running sum")
                outputs[f"product{j}"], outputs[f"running{j}"] = product, running
            outputs["value"] = running
            trace.add(f"{prefix}_mix_{i}_{d}", inputs, outputs)
            mixed.append(running)
    joined = []
    for i, value in enumerate(mixed):
        joined.append(value)
        trace.add(f"{prefix}_join_{i}", dict(source=value), dict(value=value))
    attention = _accumulate_rows(joined, 2, matrices["o"], 2, trace, prefix + "_WO")
    residual1 = _residual(features, attention, trace, prefix + "_residual1")
    norm2 = _norm(residual1, trace, prefix + "_ln2")
    w1, w2 = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0], [gains["f"], 0.0, 0.0, gains["f"], 0.0, 0.0]
    preactivation = _two_products(norm2, w1, trace, prefix + "_ffn_hidden", [0.0, 0.0, 0.0], 3)
    hidden = []
    for i, value in enumerate(preactivation):
        activation = value if value > 0.0 else 0.0
        hidden.append(activation)
        trace.add(f"{prefix}_relu_{i}", dict(preactivation=value), dict(activation=activation))
    ffn = _accumulate_rows(hidden, 3, w2, 2, trace, prefix + "_ffn_output", [0.0, 0.0])
    output = _residual(residual1, ffn, trace, prefix + "_residual2")
    return dict(input=list(features), norm1=norm1, matrices=matrices, Q=q, K=k, V=v,
                raw=raw, scores=scores, logits=logits, allowed=allowed, probabilities=probabilities,
                mixed=mixed, joined=joined, attention=attention, residual1=residual1,
                norm2=norm2, W1=w1, W2=w2, b1=[0.0]*3, b2=[0.0]*2,
                preactivation=preactivation, hidden=hidden, ffn=ffn, output=output,
                storage=_storage(output, count, 2))


def _evaluate_decoder_mechanics(state, trace, prefix):
    features, embedding, positions = [], [], []
    table = {97: (1.0, 0.0), 98: (0.0, 1.0), 512: (0.0, 0.0)}
    for t in range(2):
        token = state[f"token{t}"]
        for d in range(2):
            looked_up = table[token][d]
            position = state["positionScale"] if (t, d) == (1, 1) else 0.0
            value = _finite(looked_up + position, "embedding plus position")
            embedding.append(looked_up)
            positions.append(position)
            features.append(value)
            trace.add(f"{prefix}_position_{t}_{d}", dict(token=token, embedding=looked_up, position=position), dict(value=value))
    block1 = _decoder_block_mechanics(features, {key: state[key + "1"] for key in _GAIN_FIELDS}, trace, prefix + "_block1")
    block2 = _decoder_block_mechanics(block1["output"], {key: state[key + "2"] for key in _GAIN_FIELDS}, trace, prefix + "_block2")
    readout = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0]
    bias = [state["biasA"], state["biasB"], state["biasEOS"]]
    logits = _two_products(block2["output"], readout, trace, prefix + "_readout", bias, 3)
    probabilities, winners = [], []
    for t in range(2):
        row = logits[3*t:3*t+3]
        distribution = _softmax(row, [True, True, True], trace, f"{prefix}_class_row_{t}", positive_zero=False)
        probabilities.extend(distribution)
        best = 0
        for index in range(1, 3):
            if row[index] > row[best]:
                best = index
        winner = dict(index=best, token=_IDS[best], probability=distribution[best])
        winners.append(winner)
        trace.add(f"{prefix}_winner_{t}", {f"logit{j}": row[j] for j in range(3)}, winner)
    return dict(embedding=embedding, positions=positions, features=features, block1=block1, block2=block2,
                U=readout, bias=bias, logits=logits, probabilities=probabilities,
                winners=winners, next=winners[-1].copy(), storage=_storage(logits, 2, 3))


def check_mechanism():
    """Explicit bounded FIRST checks only; these do NOT admit public records."""
    if not __debug__:
        raise RuntimeError("Explicit mechanism self-check refuses optimized Python (-O).")
    import struct

    def words(values):
        return [struct.pack(">d", value) for value in values]

    default = decoder_state(dict(DEFAULT_IV59))
    trace = _MechanismTrace()
    result = _evaluate_decoder_mechanics(default, trace, "default")
    assert result["features"] == [1.0, 0.0, 1.0, 0.5]
    assert words(result["block2"]["input"]) == words(result["block1"]["output"])
    assert words(result["block1"]["storage"][0].flat) == words(result["block1"]["output"])
    assert result["block1"]["input"] != result["block2"]["input"]
    assert [winner["token"] for winner in result["winners"]] == [97, 97]
    assert result["next"] == result["winners"][-1] and result["next"] is not result["winners"][-1]
    assert result["block1"]["W1"] == [1.0, 0.0, 0.0, 0.0, 1.0, 0.0]
    assert result["block1"]["W2"] == [0.5, 0.0, 0.0, 0.5, 0.0, 0.0]
    assert result["block2"]["W2"] == [0.25, 0.0, 0.0, 0.25, 0.0, 0.0]
    for block in (result["block1"], result["block2"]):
        assert block["allowed"] == [True, False, True, True]
        assert words(block["probabilities"][:2]) == words([1.0, 0.0])
        assert len(block["raw"]) == 4 and len(block["preactivation"]) == 6
        assert words(block["preactivation"][2::3]) == words([0.0, 0.0])
        assert words(block["hidden"][2::3]) == words([0.0, 0.0])
    frames = {identifier: (inputs, outputs) for identifier, inputs, outputs in trace.steps}
    first = frames["default_block1_ln1_0_statistics"][1]
    assert first["sum"] == 1.0 and first["mean"] == 0.5
    assert first["centered0"] == 0.5 and first["centered1"] == -0.5
    assert first["variancePlusEpsilon"] == 0.5
    second = frames["default_block1_ln1_1_statistics"][1]
    assert second["sum"] == 1.5 and second["mean"] == 0.75
    assert second["centered0"] == 0.25 and second["centered1"] == -0.25
    assert second["variancePlusEpsilon"] == 0.3125
    assert frames["default_block1_mix_0_0"][1]["product1"] == 0.0
    native_ids = [leaf["id"] for leaf in trace.native]
    assert len(set(native_ids)) == len(native_ids)
    for leaf in trace.native:
        if leaf["kind"] == "sqrt":
            assert 0.25 <= leaf["input"] <= 4096.0
            expected = math.sqrt(leaf["input"])
        else:
            assert -256.0 <= leaf["input"] <= 0.0
            expected = math.exp(leaf["input"])
        assert words([leaf["output"]]) == words([expected])
    for layer in (1, 2):
        leaf = next(item for item in trace.native if item["id"] == f"default_block{layer}_attention_sqrt")
        for i in range(2):
            for j in range(2):
                copied = frames[f"default_block{layer}_score_{i}_{j}"][0]["divisor"]
                assert words([copied]) == words([leaf["output"]])

    zero = dict(default, o1=0.0, f1=0.0, o2=0.0, f2=0.0)
    zero_trace = _MechanismTrace()
    identity = _evaluate_decoder_mechanics(zero, zero_trace, "zero")
    for key in ("block1", "block2"):
        assert words(identity[key]["output"]) == words([1.0, 0.0, 1.0, 0.5])
        assert len(identity[key]["hidden"]) == 6
    assert words(identity["logits"]) == words([1.0, 0.0, 0.0, 1.0, 0.5, 0.0])
    for t, arguments in enumerate(((0.0, -1.0, -1.0), (0.0, -0.5, -1.0))):
        terms = [math.exp(argument) for argument in arguments]
        denominator = ((0.0 + terms[0]) + terms[1]) + terms[2]
        expected = [term / denominator for term in terms]
        assert words(identity["probabilities"][3*t:3*t+3]) == words(expected)
    assert len(zero_trace.native) == len(trace.native)
    assert len(zero_trace.steps) == len(trace.steps)

    # A changed future token cannot change any first-row result in either block.
    future_trace = _MechanismTrace()
    future = _evaluate_decoder_mechanics(dict(default, token1=98), future_trace, "future")
    assert words(future["logits"][:3]) == words(result["logits"][:3])
    assert words(future["block2"]["output"][:2]) == words(result["block2"]["output"][:2])
    tied = _evaluate_decoder_mechanics(dict(zero, token0=512, token1=512, positionScale=0.0), _MechanismTrace(), "tie")
    assert words(tied["logits"]) == words([0.0] * 6)
    assert [winner["index"] for winner in tied["winners"]] == [0, 0]
    assert [winner["token"] for winner in tied["winners"]] == [97, 97]
    for length in (2, 4, 6):
        features = [16.0, -16.0] * (length // 2)
        gains = dict(q=-1.0, k=1.0, v=-1.0, o=0.0, f=0.0)
        captured, checked_gains = _block_inputs(features, gains, "bounded")
        block = _decoder_block_mechanics(captured, checked_gains, _MechanismTrace(), "bounded")
        assert words(block["output"]) == words(features)
        assert len(block["hidden"]) == (length // 2) * 3
    captured, gains = _block_inputs([-0.0, 0.0], dict(q=-0.0, k=1, v=1, o=0, f=0), "signed")
    assert words([captured[0], gains["q"]]) == words([-0.0, -0.0])
    detached = _MechanismTrace()
    before, after = dict(x=-0.0), dict(y=1.0)
    detached.add("capture", before, after)
    before["x"], after["y"] = 8.0, 9.0
    assert words([detached.steps[0][1]["x"]]) == words([-0.0])
    assert detached.steps[0][2]["y"] == 1.0

    signed_trace = _MechanismTrace()
    _softmax([-0.0, 0.0, -1.0], [True, True, True], signed_trace, "signed_max")
    assert words([signed_trace.steps[0][2]["max"]]) == words([0.0])
    assert words([signed_trace.native[0]["input"]]) == words([-0.0])
    assert words([signed_trace.native[1]["input"]]) == words([0.0])


# Public binding projects the independent FIRST captures; it never recomputes floats.

def _numeric(value, label):
    if type(value) is int:
        # Compare before conversion: huge Python integers must not raise OverflowError.
        if not -1.7976931348623157e308 <= value <= 1.7976931348623157e308:
            raise NumericalFault("NONFINITE", label + " must be an actual finite number.")
        return value if -9007199254740991 <= value <= 9007199254740991 else float(value)
    if type(value) is not float or not math.isfinite(value):
        raise NumericalFault("NONFINITE", label + " must be an actual finite number.")
    return value


def _trace_entries(value):
    """Capture trusted items once, then use JavaScript's canonical-index order."""
    if type(value) in (list, str):
        entries = [(str(index), item) for index, item in enumerate(value)]
    elif type(value) in (int, float, bool):
        entries = []
    else:
        entries = list(value.items())  # Preserve trusted observers and their exception identity.
    indices, rest = [], []
    for key, item in entries:
        if type(key) is not str:
            raise TypeError("Trusted trace operand keys must be strings.")
        index = (bool(key) and len(key) <= 10 and all(c in "0123456789" for c in key)
                 and (key == "0" or key[0] != "0") and int(key) < 4294967295)
        (indices if index else rest).append((key, item))
    return sorted(indices, key=lambda pair: int(pair[0])) + rest


class _PublicTrace:
    """Frozen observer container, mutable collector, immutable saved frames."""
    __slots__ = ("outputs", "steps", "_ids")

    def __init__(self):
        object.__setattr__(self, "outputs", {})
        object.__setattr__(self, "steps", [])
        object.__setattr__(self, "_ids", set())

    def __setattr__(self, name, value):
        raise TypeError("Frozen trace observer.")

    def __delattr__(self, name):
        raise TypeError("Frozen trace observer.")

    def add(self, identifier, label, equation, explanation, inputs, outputs):
        if type(identifier) is not str or not identifier or identifier in self._ids:
            raise NumericalFault("INVALID_INPUT", "Trace IDs must be nonempty and unique.")
        before = {key: _numeric(value, identifier + ".inputs." + key) for key, value in _trace_entries(inputs)}
        after = {key: _numeric(value, identifier + ".outputs." + key) for key, value in _trace_entries(outputs)}
        if len(self.steps) >= 512:
            raise NumericalFault("UNSUPPORTED_SIZE", "At most 512 operations are supported.")
        frame = _freeze(dict(id=identifier, label=label, equation=equation, explanation=explanation,
                             inputs=before, outputs=after))
        self.steps.append(frame)
        self._ids.add(identifier)
        for key, value in after.items():
            alias = identifier + "_" + key
            # The actual ordinary JS object ignores numeric assignments to its inherited setter.
            if alias != "__proto__":
                self.outputs[alias] = value


_STAT_FIELDS = ("sum", "mean", "centered0", "centered1", "square0", "square1", "squareSum",
                "variance", "variancePlusEpsilon", "denominator")


def _tensor(identifier, shape, axes, values, provenance, dtype="float64"):
    return dict(id=identifier, shape=list(shape), axes=list(axes), dtype=dtype, values=list(values),
                provenance=provenance, precision=0 if dtype == "int32" else 8)


def _native_tensors(prefix, natives):
    return [
        _tensor(prefix + "_NativeArguments", [len(natives), 2], ["Native", "NativeField"],
                [value for leaf in natives for value in (leaf["input"], leaf["output"])],
                "Ordered actual native input,output words; IDs and kinds are recorded in texts.nativeIds and texts.nativeKinds. No native evaluation occurs while serializing."),
        _tensor(prefix + "_NativeKinds", [len(natives)], ["Native"],
                [0 if leaf["kind"] == "sqrt" else 1 for leaf in natives],
                "Native kind codes in native occurrence order: sqrt=0, exp=1.", "int32"),
    ]


def _native_texts(natives):
    return dict(nativeIds=[leaf["id"] for leaf in natives], nativeKinds=[leaf["kind"] for leaf in natives],
                nativeFields=["input", "output"])


def _norm_binding(mechanism, captures, trace, prefix, stage):
    T = len(mechanism["input"]) // 2
    private = prefix + ("_ln1" if stage == 1 else "_ln2")
    public = prefix + f"_n{stage}"
    statistics, centered, normalized = [], [], []
    for t in range(T):
        before, after = captures[f"{private}_{t}_statistics"]
        trace.add(f"{public}_0_{t}_statistics", f"0_{t}: feature-only mean and population variance",
                  "sum=x0+x1; mean=sum/2; centered=x-mean; squareSum=centered0²+centered1²; variance=squareSum/2; denominator=sqrt(variance+epsilon)",
                  "Only these two features contribute. Epsilon is inside the square root; no batch or token statistics are mixed.",
                  dict(before), dict(after))
        statistics.extend(after[key] for key in _STAT_FIELDS)
        centered.extend((after["centered0"], after["centered1"]))
        for d in range(2):
            before, after = captures[f"{private}_{t}_feature_{d}"]
            trace.add(f"{public}_0_{t}_feature_{d}", f"0_{t}: affine feature {d}",
                      "normalized=source/denominator; scaled=gamma*normalized; value=scaled+beta",
                      "The source is the saved centered feature. Gamma and beta may change output mean and variance.",
                      dict(d=d, **before), dict(after))
            normalized.append(after["normalized"])
    shape, axes = [1, T, 2], ["B", "T", "D"]
    return [
        _tensor(public + "_Gamma", [2], ["D"], [1.0, 1.0], "Shared literal feature scales [1,1]."),
        _tensor(public + "_Beta", [2], ["D"], [0.0, 0.0], "Shared literal feature offsets [+0,+0]."),
        _tensor(public + "_Statistics", [1, T, 10], ["B", "T", "NormStatistic"], statistics,
                "Actual sum,mean,centered0,centered1,square0,square1,squareSum,variance,variancePlusEpsilon,denominator in token order."),
        _tensor(public + "_Centered", shape, axes, centered, "Actual saved input feature minus feature mean, before division."),
        _tensor(public + "_Normalized", shape, axes, normalized, "Actual centered/denominator words before gamma multiplication and beta addition."),
        _tensor(public + "_Output", shape, axes, mechanism[f"norm{stage}"], "Actual per-position feature LayerNorm affine output; gamma=[1,1], beta=[0,0], epsilon=1/4."),
    ]


def _block_natives(captured, prefix, T):
    names = {f"{prefix}_ln1_{t}_sqrt": f"{prefix}_n1_0_{t}_sqrt" for t in range(T)}
    names[prefix + "_attention_sqrt"] = prefix + "_attn_sqrt"
    for i in range(T):
        for j in range(i + 1):
            names[f"{prefix}_attention_row_{i}_exp_{j}"] = f"{prefix}_attn_exp_0_0_{i}_{j}"
    names.update({f"{prefix}_ln2_{t}_sqrt": f"{prefix}_n2_0_{t}_sqrt" for t in range(T)})
    return [dict(id=names[leaf["id"]], kind=leaf["kind"], input=leaf["input"], output=leaf["output"])
            for leaf in captured]


def _residual_binding(mechanism, captures, trace, prefix, stage, left_id, right_id):
    T = len(mechanism["input"]) // 2
    identifier = prefix + ("_R1" if stage == 1 else "_Output")
    for t in range(T):
        for d in range(2):
            before, after = captures[f"{prefix}_residual{stage}_{2*t+d}"]
            trace.add(f"{prefix}_r{stage}_0_{t}_{d}", f"{identifier}[0,{t},{d}]: skip plus branch", "value=skip+branch",
                      "The unchanged same-shape primitive performs this actual feature addition. Both residuals are always on; no broadcasting or zero-gain bypass occurs.",
                      dict(b=0, t=t, d=d, skip=before["left"], branch=before["right"]), dict(after))
    return _tensor(identifier, [1, T, 2], ["B", "T", "D"],
                   mechanism["residual1" if stage == 1 else "output"],
                   f"Exact named-shape addition of {left_id} and {right_id}; no broadcasting.")


def _bind_block(features, gains, mechanism, captured, trace, prefix):
    T = len(features) // 2
    captures = {identifier: (before, after) for identifier, before, after in captured.steps}
    natives = _block_natives(captured.native, prefix, T)
    tensors = [
        _tensor(prefix + "_Features", [1, T, 2], ["B", "T", "D"], features,
                "Actual captured per-position block features; repeated token IDs do not merge positions."),
        _tensor(prefix + "_Gains", [5], ["Gain"], [gains[key] for key in _GAIN_FIELDS],
                "Actual q,k,v,o,f gain words; diagonal slots copy these words and off-diagonal slots are literal +0."),
    ]
    tensors.extend(_norm_binding(mechanism, captures, trace, prefix, 1))
    a = prefix + "_attn"
    setup = dict(B=1, T=T, H=1, Dk=2, Dv=2)
    for name in ("x000", "x001", "x010", "x011", "x020", "x021", "x100", "x101", "x110", "x111", "x120", "x121"):
        setup[name] = 0.0
    for kind in ("q", "k", "v"):
        for name in ("000", "001", "010", "011", "100", "101", "110", "111"):
            setup["w" + kind + name] = gains[kind] if name in ("000", "101") else 0.0
    setup.update(mode=1, valid0=1, valid1=1, valid2=1, shift=0.0)
    for name in ("000", "001", "010", "011", "100", "101", "110", "111"):
        setup["wo" + name] = gains["o"] if name in ("000", "011") else 0.0
    for t in range(T):
        for d in range(2):
            setup[f"x0{t}{d}"] = mechanism["norm1"][2*t+d]
    trace.add(a + "_setup", "Validate every scalar slot, then select active dimensions",
              "D=2; X[B,T,2]; WQ,WK[2,H*Dk]; WV[2,H*Dv]",
              "All inactive fields remain finite and bounded. Parameter names identify input d, head h and feature f, so changing width never relabels a head’s weights.",
              setup, dict(B=1, T=T, D=2, H=1, Dk=2, Dv=2))
    for kind in ("Q", "K", "V"):
        for t in range(T):
            for f in range(2):
                before, after = captures[f"{prefix}_{kind}_{t}_{f}"]
                trace.add(f"{a}_project_{kind}_0_{t}_0_{f}", f"{kind}[0,{t},head 0,feature {f}]: both input contributions",
                          "product0=x0*w0; product1=x1*w1; value=product0+product1",
                          "One token row times the packed column h*F+f, keeping both input-feature rows. Weights are hand-set; no bias, activation or learning is hidden.",
                          dict(b=0, t=t, h=0, f=f, **before),
                          dict(product0=after["product0"], product1=after["product1"], value=after["value"]))
    for kind in ("Q", "K", "V"):
        trace.add(f"{a}_reshape_{kind}", f"{kind}: reshape the packed feature axis",
                  "[B,T,H*F] → [B,T,H,F]; feature=h*F+f",
                  "Reshaping preserves every flat value and its order. H counts attention heads; F counts features within each head. No projection feature is dropped.",
                  dict(B=1, T=T, H=1, F=2, features=2, elements=2*T), dict(elements=2*T))
        for t in range(T):
            for f in range(2):
                before, after = captures[f"{prefix}_{kind}_split_{2*t+f}"]
                trace.add(f"{a}_permute_{kind}_0_0_{t}_{f}", f"{kind}: copy [0,{t},0,{f}] to [0,0,{t},{f}]",
                          "axes [0,2,1,3]; destination[b,h,t,f]=source[b,t,h,f]",
                          "Moving the head axis is a declared permutation, separate from reshape. The recorded offsets are actual row-major flat indices; this indexed value is copied unchanged.",
                          dict(b=0, h=0, t=t, f=f, feature=f, sourceOffset=2*t+f, destinationOffset=2*t+f, sourceValue=before["source"]), dict(after))
    for i in range(T):
        for j in range(T):
            before, after = captures[f"{prefix}_score_{i}_{j}"]
            trace.add(f"{a}_score_0_0_{i}_{j}", f"Batch 0, head 0: query {i} against key {j}",
                      "product0=q0*k0; product1=q1*k1; raw=product0+product1; score=raw/sqrt(Dk)",
                      "Matching features are multiplied inside this batch and head only. Dk, not H or T or Dv, supplies the scaling width. Signed scores are not probabilities.",
                      dict(b=0, h=0, i=i, j=j, Dk=2, divisor=before["divisor"], q0=before["q0"], k0=before["k0"], q1=before["q1"], k1=before["k1"]), dict(after))
    for i in range(T):
        before, after = captures[f"{prefix}_attention_row_{i}"]
        inputs = dict(b=0, h=0, i=i, mode=1, shift=0.0)
        inputs.update({f"score{j}": mechanism["scores"][i*T+j] for j in range(T)})
        inputs.update({f"allowed{j}": before[f"allowed{j}"] for j in range(T)})
        outputs = dict(max=after["max"], denominator=after["denominator"])
        outputs.update({f"shifted{j}": after[f"shifted{j}"] for j in range(i+1)})
        outputs.update({f"term{j}": after[f"term{j}"] for j in range(T)})
        outputs.update({f"p{j}": after[f"p{j}"] for j in range(T)})
        trace.add(f"{a}_row_0_0_{i}", f"Batch 0, head 0, query {i}: key-axis stable softmax",
                  "logit_j=score_j+shift; max=max(allowed logits); term_j=allowed_j?exp(logit_j-max):0; denominator=sum_j term_j; p_j=term_j/denominator",
                  "Each head has its own probabilities. Key validity is shared across batches and heads; queries remain. Forbidden terms are exactly zero, without an infinity sentinel or invented shifted value. Allowed terms can underflow; a large common shift can change low bits.", inputs, outputs)
    for i in range(T):
        for f in range(2):
            before, after = captures[f"{prefix}_mix_{i}_{f}"]
            outputs = {f"product{j}": after[f"product{j}"] for j in range(T)}
            outputs.update({f"running{j}": after[f"running{j}"] for j in range(T)})
            outputs["value"] = after["value"]
            trace.add(f"{a}_head_mix_0_0_{i}_{f}", f"OHeads[0,0,{i},{f}]: this head’s weighted values",
                      "product_j=p_j*v_j; running starts at 0; running_j=previous+product_j; value=last running sum",
                      "Use the real probability row and values in the same head and batch. Compute each product, then immediately accumulate in ascending key order, including actual zero times V for forbidden keys. No averaging across heads or extra division.",
                      dict(b=0, h=0, i=i, f=f, **before), outputs)
    for t in range(T):
        for f in range(2):
            before, after = captures[f"{prefix}_join_{2*t+f}"]
            trace.add(f"{a}_concat_0_{t}_0_{f}", f"Join head 0, feature {f} into C[0,{t},{f}]", "C[b,t,h*Dv+f]=OHeads[b,h,t,f]",
                      "Copy one actual head output unchanged. Concatenate in head order then within-head feature order; never average heads or mix batches.",
                      dict(b=0, t=t, h=0, f=f, concatFeature=f, sourceOffset=2*t+f, destinationOffset=2*t+f, sourceValue=before["source"]), dict(after))
    for t in range(T):
        for d in range(2):
            before, after = captures[f"{prefix}_WO_{t}_{d}"]
            inputs = dict(b=0, t=t, d=d, c0=before["x0"], w0=before["w0"], c1=before["x1"], w1=before["w1"])
            outputs = {key: after[key] for key in ("product0", "product1", "running0", "running1", "value")}
            trace.add(f"{a}_output_0_{t}_{d}", f"Y[0,{t},{d}]: explicit output projection",
                      "product_c=C_c*WO[c,d]; running starts at 0; running_c=previous+product_c; Y=last running sum",
                      "WO rows preserve named head/feature identity when Dv changes. Every joined feature contributes one recorded product and running sum. Y may be signed; no output softmax, bias, residual, dropout or normalization is added.", inputs, outputs)
    tensors.extend(_attention_tensors(mechanism, a, T))
    tensors.append(_residual_binding(mechanism, captures, trace, prefix, 1, prefix + "_Features", a + "_Y"))
    tensors.extend(_norm_binding(mechanism, captures, trace, prefix, 2))
    tensors.extend(_ffn_binding(mechanism, captures, trace, prefix, T))
    output = _residual_binding(mechanism, captures, trace, prefix, 2, prefix + "_R1", prefix + "_ffn_F")
    tensors.extend([output, *_native_tensors(prefix, natives)])
    texts = dict(**_native_texts(natives), gainFields=list(_GAIN_FIELDS), normStatisticFields=list(_STAT_FIELDS),
        featurePolicy="One batch, one to three positions, two features per position. Block output keeps B,T,D axes and feeds the next block directly; it is never a token lookup.",
        kernelPolicy="Unchanged p07 featureNorm, p06 projectHeads/attendHeads/joinHeads, p07 feedForward and sameShapeAdd perform all scalar arithmetic. All inactive attention state slots are explicit +0 except validity=1; active dimensions are B1,H1,Dk2,Dv2,mode1,shift+0. Every matrix coordinate and all three FFN hidden coordinates are computed at every gain.",
        nativePolicy="Occurrence order is LN1 sqrt by token, one sqrt(Dk), allowed attention exp by query/key, then LN2 sqrt by token. LN arguments/outputs and attention divisor/terms copy actual primitive records. Old stableSoftmax trace shifted values repeat the same subtraction of immutable logit and max operands as its exp arguments: functional reconstruction, not a physical instruction trace. Masked cells have no exp occurrence. No native math occurs in serialization.",
        zeroPolicy="Feature words, gain words, arithmetic results and every copy retain binary64 WORD, including allowed -0. Diagonal weights copy gains; every off-diagonal or inactive weight is literal +0. Dimensions, indices, mask decisions and native kind codes use VALUE.",
        limitsPolicy="Forward-only authored toy. No differentiated loss, training, optimizer, dropout, sampling, KV cache, physical timing or production-model claim. Public input features are bounded [-16,16], gains [-1,1]; epsilon=1/4, gamma=[1,1], beta=[0,0], width-three ReLU FFN.")
    return _freeze(dict(features=features, gains=gains, output=output, natives=natives, tensors=tensors, texts=texts))


def _attention_tensors(m, prefix, T):
    shape, axes = [1, T, 2], ["B", "T", "D"]
    result = [_tensor(prefix + "_X", shape, axes, m["norm1"], "Active token rows; D=2 input features always retained.")]
    for kind, feature, provenance in (
        ("Q", "QueryFeature", "Query columns packed by h*Dk+f from wq{d}{h}{f}."),
        ("K", "KeyFeature", "Key columns packed by h*Dk+f from wk{d}{h}{f}."),
        ("V", "ValueFeature", "Value columns packed by h*Dv+f from wv{d}{h}{f}.")):
        result.append(_tensor(prefix + "_W" + kind, [2, 2], ["D", feature], m["matrices"][kind.lower()], provenance))
    for kind, feature, provenance in (
        ("Q", "QueryFeature", "XWQ; each packed coordinate has two products and one sum."),
        ("K", "KeyFeature", "XWK; each packed coordinate has two products and one sum."),
        ("V", "ValueFeature", "XWV; values are projected separately from queries and keys.")):
        result.append(_tensor(prefix + "_" + kind + "Concat", shape, ["B", "T", feature], m[kind], provenance))
    for kind in ("Q", "K", "V"):
        width = "Dv" if kind == "V" else "Dk"
        result.extend([
            _tensor(prefix + "_" + kind + "Split", [1, T, 1, 2], ["B", "T", "H", width], m[kind],
                    kind + "Concat reshaped without changing flat order; feature=h*F+f."),
            _tensor(prefix + "_" + kind + "Heads", [1, 1, T, 2], ["B", "H", "T", width], m[kind],
                    kind + "Split permuted by axes [0,2,1,3]; every copied source/destination offset is traced."),
        ])
    shape, axes = [1, 1, T, T], ["B", "H", "Query", "Key"]
    for key, provenance, dtype in (
        ("raw", "Separate QHeads KHeads transpose products within every batch and head.", "float64"),
        ("scores", "raw/sqrt(Dk); the two-product order matches IV25 for H1,Dk2.", "float64"),
        ("allowed", "Causal and/or valid-key mask; shared validity across B and H; every query retained.", "bool"),
        ("logits", "Finite score+shift, including forbidden cells; mask applied separately.", "float64"),
        ("probabilities", "Stable allowed-key softmax for each B/H/query independently; forbidden probabilities exactly zero.", "float64")):
        result.append(_tensor(prefix + "_" + key, shape, axes, m[key], provenance, dtype))
    result.extend([
        _tensor(prefix + "_OHeads", [1, 1, T, 2], ["B", "H", "Query", "Dv"], m["mixed"], "Actual per-head P times VHeads; every product and running sum is traced."),
        _tensor(prefix + "_C", [1, T, 2], ["B", "T", "JoinedValue"], m["joined"], "OHeads permuted to token-major order then joined by c=h*Dv+f; values unchanged."),
        _tensor(prefix + "_WO", [2, 2], ["JoinedValue", "D"], m["matrices"]["o"], "wo{h}{f}{d} packed in h,f,d order, preserving parameter identity."),
        _tensor(prefix + "_Y", [1, T, 2], ["B", "T", "D"], m["attention"], "Y=C WO, summing products in ascending joined-feature order from zero; no normalization."),
    ])
    return result


def _ffn_binding(m, captures, trace, prefix, T):
    f = prefix + "_ffn"
    for t in range(T):
        for hidden in range(3):
            before, after = captures[f"{prefix}_ffn_hidden_{t}_{hidden}"]
            trace.add(f"{f}_hidden_0_{t}_{hidden}", f"Hidden affine [0,{t},{hidden}]",
                      "product0=x0*w0; product1=x1*w1; sum=product0+product1; preactivation=sum+bias",
                      "The same W1 and b1 apply separately to each token. Add bias after the two input products; no token sum occurs.",
                      dict(b=0, t=t, m=hidden, **before),
                      dict(product0=after["product0"], product1=after["product1"], sum=after["sum"], preactivation=after["value"]))
    for t in range(T):
        for hidden in range(3):
            before, after = captures[f"{prefix}_relu_{3*t+hidden}"]
            trace.add(f"{f}_relu_0_{t}_{hidden}", f"ReLU [0,{t},{hidden}]", "activation=max(0,preactivation)",
                      "ReLU means rectified linear unit: keep a positive value and replace a nonpositive value with zero, including zero itself.",
                      dict(b=0, t=t, m=hidden, **before), dict(after))
    for t in range(T):
        for d in range(2):
            before, after = captures[f"{prefix}_ffn_output_{t}_{d}"]
            inputs = dict(b=0, t=t, d=d)
            for hidden in range(3):
                inputs[f"h{hidden}"] = before[f"x{hidden}"]
                inputs[f"w{hidden}"] = before[f"w{hidden}"]
            inputs["bias"] = before["bias"]
            outputs = {f"product{hidden}": after[f"product{hidden}"] for hidden in range(3)}
            outputs.update({f"running{hidden}": after[f"running{hidden}"] for hidden in range(3)})
            outputs.update(sum=after["running2"], value=after["value"])
            trace.add(f"{f}_output_0_{t}_{d}", f"FFN output [0,{t},{d}]",
                      "product_m=h_m*w_m; running starts at 0; running_m=previous+product_m; sum=running2; value=sum+bias",
                      "Multiply then immediately accumulate hidden features in ascending order 0,1,2. Add b2 last. Output may be signed; there is no softmax or residual inside the FFN.", inputs, outputs)
    return [
        _tensor(f + "_W1", [2, 3], ["D", "HiddenFeature"], m["W1"], "Shared input-to-hidden weights, f1{d}{m}; M=3 hidden features."),
        _tensor(f + "_b1", [3], ["HiddenFeature"], m["b1"], "Shared hidden bias, added after the two products."),
        _tensor(f + "_Z", [1, T, 3], ["B", "T", "HiddenFeature"], m["preactivation"], "Hidden preactivations X W1+b1; no batch or token mixing."),
        _tensor(f + "_Hidden", [1, T, 3], ["B", "T", "HiddenFeature"], m["hidden"], "ReLU(Z)=max(0,Z), before the second affine layer."),
        _tensor(f + "_W2", [3, 2], ["HiddenFeature", "D"], m["W2"], "Shared hidden-to-output weights, f2{m}{d}."),
        _tensor(f + "_b2", [2], ["D"], m["b2"], "Shared output bias, added after all three running sums."),
        _tensor(f + "_F", [1, T, 2], ["B", "T", "D"], m["ffn"], "ReLU(X W1+b1) W2+b2, independently per token with shared parameters."),
    ]


def decoder_block(features, gains, trace, prefix):
    """Adopted helper, scalar FIRST plus complete metadata/copy projection."""
    features, gains = _block_inputs(features, gains, prefix)
    captured = _MechanismTrace()
    mechanism = _decoder_block_mechanics(features, gains, captured, prefix)
    return _bind_block(features, gains, mechanism, captured, trace, prefix)


def _head_binding(mechanism, captures, captured_natives, trace, prefix):
    logits, probabilities = mechanism["logits"], mechanism["probabilities"]
    maxima, shifted, terms, denominators, readout = [], [], [], [], []
    for t in range(2):
        for c in range(3):
            before, after = captures[f"{prefix}_readout_{t}_{c}"]
            trace.add(f"{prefix}_readout_{t}_{c}", f"Readout at position {t}, class {c}",
                      "product0=x0*u0; product1=x1*u1; sum=product0+product1; logit=sum+bias",
                      "Both final block features contribute through actual products for every class, including zero weights. Add that class bias last. U is hand-set, not trained.",
                      dict(t=t, c=c, x0=before["x0"], x1=before["x1"], u0=before["w0"], u1=before["w1"], bias=before["bias"]),
                      dict(product0=after["product0"], product1=after["product1"], sum=after["sum"], logit=after["value"]))
            readout.extend((after["product0"], after["product1"], after["sum"], after["value"]))
    for t in range(2):
        before, after = captures[f"{prefix}_class_row_{t}"]
        maximum = after["max"]
        maxima.append(maximum)
        trace.add(f"{prefix}_classMax_{t}", f"Stable class maximum at position {t}",
                  "max=logit0; scan class1,class2; replace only on strict greater",
                  "The maximum is selected from the actual saved logits. Class order is a,b,EOS with ascending IDs 97,98,512.",
                  {f"logit{c}": logits[3*t+c] for c in range(3)}, dict(max=maximum))
        for c in range(3):
            argument, term = after[f"shifted{c}"], after[f"term{c}"]
            shifted.append(argument)
            terms.append(term)
            trace.add(f"{prefix}_classExp_{t}_{c}", f"Stable class exponential at position {t}, class {c}",
                      "shifted=logit-max; term=exp(shifted)",
                      "Save the exact argument and output at this native exp call. The argument is nonpositive; there is no logarithm or hidden loss.",
                      dict(logit=logits[3*t+c], max=maximum), dict(shifted=argument, term=term))
        for c in range(3):
            previous = 0.0 if c == 0 else after[f"running{c-1}"]
            trace.add(f"{prefix}_classSum_{t}_{c}", f"Ordered class denominator at position {t}, class {c}", "sum=previous+term",
                      "Start from literal +0 and immediately add terms in class order 0,1,2. Keep this actual running sum; do not simplify equal terms.",
                      dict(previous=previous, term=after[f"term{c}"]), dict(sum=after[f"running{c}"]))
        denominators.append(after["denominator"])
        for c in range(3):
            trace.add(f"{prefix}_classProbability_{t}_{c}", f"Class probability at position {t}, class {c}", "probability=term/denominator",
                      "Divide the saved class term by the final saved ordered denominator. Display rounding is never an operand.",
                      dict(term=after[f"term{c}"], denominator=after["denominator"]), dict(probability=probabilities[3*t+c]))
        winner = mechanism["winners"][t]
        inputs = {f"logit{c}": logits[3*t+c] for c in range(3)}
        inputs.update({f"probability{c}": probabilities[3*t+c] for c in range(3)})
        trace.add(f"{prefix}_argmax_{t}", f"Greedy recommendation from position {t}",
                  "index=first maximum logit; tokenId=IDS[index]; probability=probabilities[index]",
                  "Strict-greater scanning retains the smallest actual token ID on an exact logit tie. This row recommends the next token after this observed prefix; it does not append it.",
                  inputs, dict(index=winner["index"], tokenId=winner["token"], probability=winner["probability"]))
    natives = []
    for leaf in captured_natives:
        # Only readout leaves are supplied; each name is a direct occurrence copy.
        suffix = leaf["id"].removeprefix(prefix + "_class_row_")
        t, c = suffix.split("_exp_")
        natives.append(dict(id=f"{prefix}_readout_exp_{t}_{c}", kind=leaf["kind"], input=leaf["input"], output=leaf["output"]))
    return dict(readout=readout, maxima=maxima, shifted=shifted, terms=terms, denominators=denominators, natives=natives)


def evaluate_decoder(value, trace, prefix):
    """All actual scalar values are captured before metadata projection."""
    state = decoder_state(value)
    _prefix(prefix)
    captured = _MechanismTrace()
    mechanism = _evaluate_decoder_mechanics(state, captured, prefix)
    captures = {identifier: (before, after) for identifier, before, after in captured.steps}
    for t in range(2):
        token_id = state[f"token{t}"]
        row = _IDS.index(token_id)
        for d in range(2):
            before, after = captures[f"{prefix}_position_{t}_{d}"]
            trace.add(f"{prefix}_embedding_{t}_{d}", f"Observed position {t}, feature {d}: lookup then add position", "feature=embedding+position",
                      "Look up this observed token ID in the authored E table and add the displayed absolute-position coordinate. An observed EOS has its explicit zero row; no token is generated or silently stopped.",
                      dict(t=t, d=d, tokenId=token_id, row=row, embedding=before["embedding"], position=before["position"]), dict(feature=after["value"]))
    blocks = []
    for layer in (1, 2):
        block_prefix = prefix + f"_block{layer}"
        block_capture = _MechanismTrace()
        block_capture.steps = [frame for frame in captured.steps if frame[0].startswith(block_prefix + "_")]
        block_capture.native = [leaf for leaf in captured.native if leaf["id"].startswith(block_prefix + "_")]
        m = mechanism[f"block{layer}"]
        gains = {key: state[key + str(layer)] for key in _GAIN_FIELDS}
        blocks.append(_bind_block(m["input"], gains, m, block_capture, trace, block_prefix))
    block1, block2 = blocks
    head = _head_binding(mechanism, captures, [leaf for leaf in captured.native if leaf["id"].startswith(prefix + "_class_row_")], trace, prefix)
    natives = [*block1["natives"], *block2["natives"], *head["natives"]]
    indices = [winner["index"] for winner in mechanism["winners"]]
    ids = [winner["token"] for winner in mechanism["winners"]]
    selected = [winner["probability"] for winner in mechanism["winners"]]
    tensors = _evaluation_tensors(state, mechanism, block1, block2, head, natives, prefix, indices, ids, selected)
    texts = _evaluation_texts(natives)
    return _freeze(dict(state=state, features=mechanism["features"], block1=block1, block2=block2,
                        logits=mechanism["logits"], probabilities=mechanism["probabilities"], argmaxIndices=indices,
                        argmaxIds=ids, selectedProbabilities=selected, nextTokenId=ids[1], nextTokenProbability=selected[1],
                        natives=natives, tensors=tensors, texts=texts))


def _evaluation_tensors(state, m, block1, block2, head, natives, p, indices, ids, selected):
    return [
        _tensor(p + "_Raw", [16], ["RawField"], [state[key] for key in _FIELDS], "Captured raw16 in declared field order; token0/token1 cells are integer VALUE, all other cells binary64 WORD."),
        _tensor(p + "_TokenIds", [1, 2], ["B", "T"], [state["token0"], state["token1"]], "Both observed input token IDs; EOS is an ordinary explicit lookup row here.", "int32"),
        _tensor(p + "_VocabularyIds", [3], ["Vocab"], _IDS, "Class order and strict-tie ID order: a=97,b=98,EOS=512.", "int32"),
        _tensor(p + "_E", [3, 2], ["Vocab", "D"], [1.0, 0.0, 0.0, 1.0, 0.0, 0.0], "Authored embedding rows [1,0],[0,1],[0,0] for a,b,EOS."),
        _tensor(p + "_Positions", [1, 2, 2], ["B", "T", "D"], m["positions"], "Literal P0=[+0,+0], P1=[+0,positionScale]; disclosed absolute position addition."),
        _tensor(p + "_Embeddings", [1, 2, 2], ["B", "T", "D"], m["embedding"], "Actual E lookup copies before position addition."),
        _tensor(p + "_Features", [1, 2, 2], ["B", "T", "D"], m["features"], "Actual lookup plus position sums; first block input, retained on its residual skip."),
        *block1["tensors"], *block2["tensors"],
        _tensor(p + "_U", [2, 3], ["D", "Vocab"], m["U"], "Authored feature-last readout rows [1,0,0],[0,1,0]."),
        _tensor(p + "_Bias", [3], ["Vocab"], m["bias"], "Actual biasA,biasB,biasEOS words, added after both feature products."),
        _tensor(p + "_Readout", [1, 2, 3, 4], ["B", "T", "Vocab", "ReadoutField"], head["readout"], "Actual product0,product1,sum,logit per position and class."),
        _tensor(p + "_Logits", [1, 2, 3], ["B", "T", "Vocab"], m["logits"], "Actual final readout logits before stable class softmax."),
        _tensor(p + "_ClassMaxima", [1, 2], ["B", "T"], head["maxima"], "Actual selected maximum logit per observed position."),
        _tensor(p + "_ClassShifted", [1, 2, 3], ["B", "T", "Vocab"], head["shifted"], "Actual direct exp arguments, each saved once as logit minus row maximum."),
        _tensor(p + "_ClassTerms", [1, 2, 3], ["B", "T", "Vocab"], head["terms"], "Actual native exp outputs; no log native exists in this family."),
        _tensor(p + "_ClassDenominators", [1, 2], ["B", "T"], head["denominators"], "Final ordered +0 then term0,term1,term2 running sums."),
        _tensor(p + "_Probabilities", [1, 2, 3], ["B", "T", "Vocab"], m["probabilities"], "Actual term/final denominator probabilities at every observed position."),
        _tensor(p + "_ArgmaxIndices", [1, 2], ["B", "T"], indices, "Smallest class index on exact actual-logit ties.", "int32"),
        _tensor(p + "_ArgmaxIds", [1, 2], ["B", "T"], ids, "Actual selected token IDs in observed-position order.", "int32"),
        _tensor(p + "_SelectedProbabilities", [1, 2], ["B", "T"], selected, "Unchanged copies of the actual selected class probabilities."),
        *_native_tensors(p, natives),
    ]


def _evaluation_texts(natives):
    return dict(**_native_texts(natives), rawFields=list(_FIELDS), vocabularyLabels=["a", "b", "EOS"],
        gainFields=list(_GAIN_FIELDS), normStatisticFields=list(_STAT_FIELDS), readoutFields=["product0", "product1", "sum", "logit"],
        inputPolicy="Exact own-data raw16 on a plain/null-prototype object: all descriptors, then all actual finite numbers, then domains in raw order, then ASCII prefix. Tokens are integer members {97,98,512}; positionScale [0,1]; ten gains [-1,1]; three biases [-2,2]. No coercion, clamping, partial defaults or skipped inactive computation.",
        architecturePolicy="B1,T2,D2,H1,Dk2,Dv2. Look up both observed IDs, add absolute positions, compute two distinct pre-norm causal blocks on actual per-position features, then compute all three readout logits and class probabilities at both positions. Block2 consumes block1 output words, never token IDs or re-embedded values.",
        headPolicy="U rows [1,0,0],[0,1,0]; each logit uses two products, sum, bias last. Stable class softmax saves exp arguments/outputs, ordered +0 term sum and divisions. Greedy strict-greater scan over ascending IDs keeps the smallest token ID on exact logit ties. Only the last observed row supplies nextTokenId and nextTokenProbability; no token is appended.",
        nativePolicy="Both complete block-native ledgers precede output-head exp occurrences in token/class order. LN sqrt and attention sqrt(Dk) save actual outputs. Old attention shifted arguments repeat the identical immutable-operand subtraction used internally by stableSoftmax: functional word reconstruction, not a physical instruction trace. Output-head exp arguments are captured directly. No log, sin, cos or native call during serialization.",
        numericPolicy="Separate finite binary64 scalar operations retain primitive order without contraction or reassociation. Every numeric operand/result/copy uses WORD including admitted -0, except explicit token IDs, indices, dimensions, mask decisions, kind codes and counts use VALUE. Display precision8 is presentation only. Root Raw token cells are VALUE and its other fourteen cells are WORD.",
        nativeAdmissionPolicy="Declared future independent policy: positive finite sqrt outputs with argument [1/4,4096] and exp outputs with argument [-256,0], at most four ordered binary64 word steps from an independently isolated RN-even reference. Admit each complete TS/canonical record separately, then require exact scalar/copy words inside it. This is neither bit-exact libm parity nor validation evidence.",
        limitsPolicy="Authored forward-only toy with hand-set embeddings, gains, norms, FFN and readout. Two blocks are neither two generated tokens nor two optimizer steps. An observed EOS is an input embedding; generated-EOS stopping is not implemented. No loss, gradient, training, sampling, cache, latency, production intelligence or physical-trace claim. Runtime validation remains deferred under the FluxGeo hold.",
        provenance="Owner-chosen IV59 toy within the human full-book source authorization; these concrete model choices are not attributed to the human or the dossier. No external model or dataset.")


def _check_native_copies(natives, tensors, texts, frames, prefix):
    if not __debug__:
        raise RuntimeError("Explicit native-copy self-check refuses optimized Python (-O).")
    import struct

    def word(value):
        return struct.pack(">d", value)

    table = {record["id"]: record for record in tensors}
    arguments = table[prefix + "_NativeArguments"]["values"]
    kinds = table[prefix + "_NativeKinds"]["values"]
    assert texts["nativeFields"] == ["input", "output"]
    assert texts["nativeIds"] == [leaf["id"] for leaf in natives]
    assert texts["nativeKinds"] == [leaf["kind"] for leaf in natives]
    assert len(arguments) == 2 * len(natives) and len(kinds) == len(natives)
    for n, leaf in enumerate(natives):
        assert tuple(leaf) == ("id", "kind", "input", "output")
        assert word(arguments[2*n]) == word(leaf["input"])
        assert word(arguments[2*n+1]) == word(leaf["output"])
        assert kinds[n] == (0 if leaf["kind"] == "sqrt" else 1)
        identifier = leaf["id"]
        if leaf["kind"] == "sqrt" and "_attn_sqrt" not in identifier:
            statistics_id = identifier.removesuffix("_sqrt") + "_statistics"
            frame = frames[statistics_id]
            assert word(leaf["input"]) == word(frame["outputs"]["variancePlusEpsilon"])
            assert word(leaf["output"]) == word(frame["outputs"]["denominator"])
            norm_prefix, t = identifier.removesuffix("_sqrt").rsplit("_0_", 1)
            row = table[norm_prefix + "_Statistics"]["values"][10*int(t):10*int(t)+10]
            assert word(row[8]) == word(leaf["input"]) and word(row[9]) == word(leaf["output"])
            for d in range(2):
                copied = frames[f"{norm_prefix}_0_{t}_feature_{d}"]["inputs"]["denominator"]
                assert word(copied) == word(leaf["output"])
        elif leaf["kind"] == "sqrt":
            attention = identifier.removesuffix("_sqrt")
            assert leaf["input"] == 2.0
            for key, frame in frames.items():
                if key.startswith(attention + "_score_"):
                    assert word(frame["inputs"]["Dk"]) == word(leaf["input"])
                    assert word(frame["inputs"]["divisor"]) == word(leaf["output"])
        elif "_readout_exp_" in identifier:
            evaluation, coordinates = identifier.split("_readout_exp_")
            t, c = (int(index) for index in coordinates.split("_"))
            frame = frames[f"{evaluation}_classExp_{t}_{c}"]
            assert word(frame["outputs"]["shifted"]) == word(leaf["input"])
            assert word(frame["outputs"]["term"]) == word(leaf["output"])
            assert word(table[evaluation + "_ClassShifted"]["values"][3*t+c]) == word(leaf["input"])
            assert word(table[evaluation + "_ClassTerms"]["values"][3*t+c]) == word(leaf["output"])
            assert word(frames[f"{evaluation}_classSum_{t}_{c}"]["inputs"]["term"]) == word(leaf["output"])
            assert word(frames[f"{evaluation}_classProbability_{t}_{c}"]["inputs"]["term"]) == word(leaf["output"])
        else:
            attention, coordinates = identifier.split("_exp_0_0_")
            i, j = (int(index) for index in coordinates.split("_"))
            frame = frames[f"{attention}_row_0_0_{i}"]
            assert frame["inputs"][f"allowed{j}"] == 1
            assert word(frame["outputs"][f"shifted{j}"]) == word(leaf["input"])
            assert word(frame["outputs"][f"term{j}"]) == word(leaf["output"])


def check_public():
    """Explicit complete helper/native/copy checks; not an independent oracle."""
    if not __debug__:
        raise RuntimeError("Explicit public-helper self-check refuses optimized Python (-O).")
    import struct

    def words(values):
        return [struct.pack(">d", value) for value in values]

    ordered = decoder_trace()
    operands = {"2": -0.0, "1": 1.0, "01": 2.0, "4294967295": 3.0, "4294967294": 4.0}
    ordered.add("order", "", "", "", operands, operands)
    expected_keys = ["1", "2", "4294967294", "01", "4294967295"]
    assert list(ordered.steps[0]["inputs"]) == list(ordered.steps[0]["outputs"]) == expected_keys
    assert list(ordered.outputs) == ["order_" + key for key in expected_keys]
    assert words([ordered.steps[0]["inputs"]["2"]]) == words([-0.0])
    reused = decoder_trace()
    reused.add("frozen", "", "", "", ordered.steps[0]["inputs"], ordered.steps[0]["outputs"])
    assert list(reused.steps[0]["inputs"]) == expected_keys
    assert words(reused.steps[0]["inputs"].values()) == words(ordered.steps[0]["inputs"].values())
    proto = decoder_trace()
    proto.add("__proto", "", "", "", {}, {"_": 1.0})
    assert proto.outputs == {} and proto.steps[0]["outputs"] == {"_": 1.0}
    proto.add("ordinary", "", "", "", {}, {"__proto__": 2.0})
    assert proto.outputs == {"ordinary___proto__": 2.0}
    large = decoder_trace()
    large.add("large", "", "", "", {"x": 2**53 + 1, "y": 10**300}, {"z": -0.0})
    assert words(large.steps[0]["inputs"].values()) == words([9007199254740992.0, 1e300])
    for huge in (10**400, -(10**400)):
        for side in ("inputs", "outputs"):
            try:
                large.add("bad", "", "", "", {"x": huge} if side == "inputs" else {}, {"x": huge} if side == "outputs" else {})
            except NumericalFault as error:
                assert error.code == "NONFINITE" and str(error) == "bad." + side + ".x must be an actual finite number."
            else:
                raise AssertionError("Huge trace integer must fail before conversion.")
    assert len(large.steps) == 1

    gains = dict(q=-0.0, k=0.5, v=-1.0, o=0.0, f=0.0)
    for T, frame_count, alias_count, native_count in ((1, 42, 127, 4), (2, 82, 266, 8), (3, 124, 426, 13)):
        features = [16.0, -16.0] * T
        trace = decoder_trace()
        block = decoder_block(features, gains, trace, "bounded")
        assert tuple(block) == ("features", "gains", "output", "natives", "tensors", "texts")
        assert len(trace.steps) == frame_count and len(trace.outputs) == alias_count
        assert len(block["tensors"]) == 47 and len(block["natives"]) == native_count
        assert len(block["texts"]) == 10 and tuple(block["gains"]) == _GAIN_FIELDS
        assert block["output"]["id"] == "bounded_Output"
        assert block["output"] == block["tensors"][44]
        assert words(block["output"]["values"]) == words(features)
        assert words(block["features"]) == words(features)
        features[0] = 3.0
        assert block["features"][0] == 16.0
        table = {record["id"]: record for record in block["tensors"]}
        frames = {frame["id"]: frame for frame in trace.steps}
        assert len(table) == 47 and len(frames) == frame_count
        assert tuple(block["texts"]) == ("nativeIds", "nativeKinds", "nativeFields", "gainFields", "normStatisticFields",
                                         "featurePolicy", "kernelPolicy", "nativePolicy", "zeroPolicy", "limitsPolicy")
        for record in block["tensors"]:
            assert tuple(record) == ("id", "shape", "axes", "dtype", "values", "provenance", "precision")
            assert len(record["shape"]) == len(record["axes"])
            assert record["precision"] == (0 if record["dtype"] == "int32" else 8)
        mask = table["bounded_attn_allowed"]
        assert mask["dtype"] == "bool" and mask["precision"] == 8
        assert mask["values"] == [j <= i for i in range(T) for j in range(T)]
        assert all(type(value) is bool for value in mask["values"])
        assert words(table["bounded_attn_WQ"]["values"]) == words([-0.0, 0.0, 0.0, -0.0])
        for stage in (1, 2):
            p = f"bounded_n{stage}"
            for t in range(T):
                statistics = frames[f"{p}_0_{t}_statistics"]["outputs"]
                assert words(table[p + "_Statistics"]["values"][10*t:10*t+10]) == words(statistics.values())
                for d in range(2):
                    frame = frames[f"{p}_0_{t}_feature_{d}"]
                    assert words([frame["inputs"]["source"]]) == words([table[p + "_Centered"]["values"][2*t+d]])
                    assert words([frame["outputs"]["normalized"]]) == words([table[p + "_Normalized"]["values"][2*t+d]])
                    assert words([frame["outputs"]["value"]]) == words([table[p + "_Output"]["values"][2*t+d]])
        for i in range(T):
            row = frames[f"bounded_attn_row_0_0_{i}"]["outputs"]
            for j in range(T):
                probability = table["bounded_attn_probabilities"]["values"][i*T+j]
                assert words([probability]) == words([row[f"p{j}"]])
                if j > i:
                    assert f"shifted{j}" not in row
                    assert words([probability, row[f"term{j}"]]) == words([0.0, 0.0])
            for d in range(2):
                mixed = frames[f"bounded_attn_head_mix_0_0_{i}_{d}"]["outputs"]["value"]
                assert words([mixed]) == words([table["bounded_attn_OHeads"]["values"][2*i+d]])
                assert words([mixed]) == words([table["bounded_attn_C"]["values"][2*i+d]])
                for suffix, source in (("r1", "R1"), ("r2", "Output")):
                    assert words([frames[f"bounded_{suffix}_0_{i}_{d}"]["outputs"]["value"]]) == words([table["bounded_" + source]["values"][2*i+d]])
            for hidden in range(3):
                index = 3*i+hidden
                assert words([frames[f"bounded_ffn_hidden_0_{i}_{hidden}"]["outputs"]["preactivation"]]) == words([table["bounded_ffn_Z"]["values"][index]])
                assert words([frames[f"bounded_ffn_relu_0_{i}_{hidden}"]["outputs"]["activation"]]) == words([table["bounded_ffn_Hidden"]["values"][index]])
        for frame in trace.steps:
            assert tuple(frame) == ("id", "label", "equation", "explanation", "inputs", "outputs")
            for key, value in frame["outputs"].items():
                assert words([value]) == words([trace.outputs[frame["id"] + "_" + key]])
        _check_native_copies(block["natives"], block["tensors"], block["texts"], frames, "bounded")
        try:
            block["output"]["values"][0] = 0.0
        except TypeError:
            pass
        else:
            raise AssertionError("Saved tensor must be immutable.")

    trace = decoder_trace()
    evaluated = evaluate_decoder(DEFAULT_IV59, trace, "observed")
    assert tuple(evaluated) == ("state", "features", "block1", "block2", "logits", "probabilities", "argmaxIndices", "argmaxIds",
                                "selectedProbabilities", "nextTokenId", "nextTokenProbability", "natives", "tensors", "texts")
    assert len(trace.steps) == 196 and len(trace.outputs) == 592
    assert len(evaluated["tensors"]) == 115 and len(evaluated["texts"]) == 16
    assert sum(len(record["values"]) for record in evaluated["tensors"]) == 640
    assert words(evaluated["block2"]["features"]) == words(evaluated["block1"]["output"]["values"])
    assert evaluated["argmaxIds"] == [97, 97]
    assert evaluated["nextTokenId"] == evaluated["argmaxIds"][1]
    assert words([evaluated["nextTokenProbability"]]) == words([evaluated["selectedProbabilities"][1]])
    frames = {frame["id"]: frame for frame in trace.steps}
    _check_native_copies(evaluated["natives"], evaluated["tensors"], evaluated["texts"], frames, "observed")
    assert [frame["id"] for frame in trace.steps if "_readout_" in frame["id"]] == [f"observed_readout_{t}_{c}" for t in range(2) for c in range(3)]
    assert next(i for i, frame in enumerate(trace.steps) if "_classMax_" in frame["id"]) > next(i for i, frame in enumerate(trace.steps) if frame["id"] == "observed_readout_1_2")

    # A fabricated logit row isolates strict-FIRST head max, even if unreachable by a particular preset.
    for first, second in ((-0.0, 0.0), (0.0, -0.0)):
        capture = _MechanismTrace()
        _softmax([first, second, -1.0], [True]*3, capture, "head", positive_zero=False)
        assert words([capture.steps[0][2]["max"]]) == words([first])
    # Serialization must consume captures even when native evaluation is disabled.
    source = [1.0, 0.0, 1.0, 0.5]
    capture = _MechanismTrace()
    mechanism = _decoder_block_mechanics(source, gains, capture, "serialized")
    saved_sqrt, saved_exp = math.sqrt, math.exp
    def forbidden(argument):
        raise AssertionError("Native evaluation during serialization.")
    try:
        math.sqrt = math.exp = forbidden
        projected = _bind_block(source, gains, mechanism, capture, decoder_trace(), "serialized")
        assert len(projected["tensors"]) == 47
    finally:
        math.sqrt, math.exp = saved_sqrt, saved_exp

2. Six-item calculation and saved projection: evaluation_reference.py

Read the complete executable Python / NumPy source

This is the actual reference file, imported directly from the repository. Comments explain each operation. It is provided for later execution; no validation run is claimed.

"""IV65 independent SIX-item scalar FIRST with owner-adopted public projection.

SOURCE ONLY. Every check is UNRUN. No producer/oracle import or implicit check.
"""
import importlib.util
import math
from pathlib import Path
import sys
from types import FunctionType, ModuleType


_CACHE_NAMES = ("_book_iv65_evaluation", "_book_iv65_generic59")


def _cache_snapshot():
    return tuple((name, name in sys.modules, sys.modules.get(name)) for name in _CACHE_NAMES)


def _cache_unchanged(snapshot):
    for name, present, incumbent in snapshot:
        if (name in sys.modules) != present or (present and sys.modules[name] is not incumbent):
            raise ImportError("IV65 cache membership changed before staging.")


def _module_identity(module, path):
    if type(module) is not ModuleType:
        raise ImportError("Unknown IV65 owned module identity.")
    namespace = module.__dict__
    certificate = namespace.get("_IV65_CERTIFICATE")
    if (type(certificate) is not tuple or len(certificate) != 6
            or certificate[0] is not module or certificate[1] != path
            or type(namespace.get("__file__")) is not str
            or str(Path(namespace["__file__"]).resolve()) != path
            or namespace.get("__spec__") is not certificate[5]
            or certificate[5] is None or type(certificate[5].origin) is not str
            or str(Path(certificate[5].origin).resolve()) != path
            or namespace.get("__name__") != certificate[5].name):
        raise ImportError("Unknown or incomplete IV65 source identity.")
    for key, function, code in certificate[2]:
        owner, dot, member = key.partition(".")
        actual = namespace.get(owner)
        if dot:
            actual = actual.__dict__.get(member) if isinstance(actual, type) else None
        if (actual is not function or type(function) is not FunctionType
                or function.__code__ is not code or function.__globals__ is not namespace
                or function.__module__ != namespace["__name__"]
                or str(Path(code.co_filename).resolve()) != path):
            raise ImportError("IV65 declaring function or code identity changed.")
    for name, dependency in certificate[3]:
        if name not in sys.modules or sys.modules[name] is not dependency:
            raise ImportError("IV65 dependency cache identity changed.")
    for key, dependency in certificate[4]:
        if namespace.get(key) is not dependency:
            raise ImportError("IV65 dependency alias changed.")
    return module


def _load_support():
    name = "_book_iv65_generic59"
    path = str(Path(__file__).resolve().with_name("decoder_reference.py"))
    if name in sys.modules:
        return _module_identity(sys.modules[name], path)
    snapshot = _cache_snapshot()
    spec = importlib.util.spec_from_file_location(name, path)
    _cache_unchanged(snapshot)
    if spec is None or spec.loader is None:
        raise ImportError("Cannot load adjacent IV65 generic59 support.")
    staged = importlib.util.module_from_spec(spec)
    _cache_unchanged(snapshot)
    transaction = globals().get("_IV65_TRANSACTION")
    if transaction is not None:
        transaction.append((name, staged))
    sys.modules[name] = staged
    try:
        spec.loader.exec_module(staged)
        if name not in sys.modules or sys.modules[name] is not staged:
            raise ImportError("IV65 support changed during loading.")
        functions = tuple((key, staged.__dict__[key], staged.__dict__[key].__code__)
                          for key in ("_freeze", "_prefix", "_storage", "decoder_trace", "_numeric", "_trace_entries"))
        functions += tuple((owner + "." + key, staged.__dict__[owner].__dict__[key],
                            staged.__dict__[owner].__dict__[key].__code__)
                           for owner, keys in (("NumericalFault", ("__init__",)),
                               ("_FrozenDict", ("_readonly", "__setitem__", "__delitem__", "clear", "pop", "popitem", "setdefault", "update", "__ior__")),
                               ("_FrozenList", ("_readonly", "__setitem__", "__delitem__", "append", "clear", "extend", "insert", "pop", "remove", "reverse", "sort", "__iadd__", "__imul__")),
                               ("_PublicTrace", ("__init__", "__setattr__", "__delattr__", "add"))) for key in keys)
        aliases = tuple((key, staged.__dict__[key]) for key in
                        ("np", "math", "re", "NumericalFault", "_FrozenDict", "_FrozenList", "_PublicTrace"))
        dependencies = (("numpy", staged.np), ("math", staged.math), ("re", staged.re))
        staged._IV65_CERTIFICATE = (staged, path, functions, dependencies, aliases, spec)
        return _module_identity(staged, path)
    except BaseException:
        if name in sys.modules and sys.modules[name] is staged:
            del sys.modules[name]
        raise


_support = _load_support()
NumericalFault = _support.NumericalFault
_freeze = _support._freeze
reliability_trace = _support.decoder_trace
DEFAULT_IV65 = _freeze(dict(p0=.75, p1=.25, p2=.75, p3=.25, p4=.5, p5=.5,
                           tau=.5, m=0, blend=0.0))
_FIELDS = tuple(DEFAULT_IV65)
_LABELS = (1, 0, 0, 1, 1, 0)


def reliability_state(value):
    """Capture all raw9 before finite checks, all finite before ordered domains."""
    if type(value) not in (dict, _support._FrozenDict):
        raise NumericalFault("INVALID_INPUT", "state must be a plain object.")
    keys = tuple(value)
    if (len(keys) != 9 or any(type(key) is not str for key in keys)
            or set(keys) != set(_FIELDS)):
        raise NumericalFault("INVALID_INPUT", "state must have exactly " + ", ".join(_FIELDS) + " as own fields.")
    captured = {key: value[key] for key in _FIELDS}
    for key in _FIELDS:
        item = captured[key]
        # Compare huge integers before conversion; NaN also fails this comparison.
        if (type(item) not in (int, float)
                or not -1.7976931348623157e308 <= item <= 1.7976931348623157e308):
            raise NumericalFault("NONFINITE", "state." + key + " must be an actual finite number.")
    for key in _FIELDS:
        item = captured[key]
        if key == "m":
            if not 0 <= item <= 6 or (type(item) is float and not item.is_integer()):
                raise NumericalFault("INVALID_INPUT", "m must be an integer from 0 to 6.")
        elif not 0 <= item <= 1:
            raise NumericalFault("INVALID_INPUT", key + " must be between 0 and 1.")
    return _freeze({key: int(captured[key]) if key == "m" else float(captured[key]) for key in _FIELDS})


def _finite(value):
    if not math.isfinite(value):
        raise NumericalFault("NONFINITE", "Evaluation arithmetic must remain finite.")
    return value


def _fold(rows, ids):
    """Fresh +0 and integer-zero folds; private evidence, no public metadata."""
    sse, maximum = 0.0, 0.0
    counts = dict(n=0, correct=0, TP=0, FN=0, FP=0, TN=0, squaredUnderflow=0)
    partials = []
    for identifier in ids:
        row = rows[identifier]
        before = dict(counts, SSE=sse, maxAbsoluteResidual=maximum)
        sse = _finite(sse + row["square"])
        counts["n"] += 1
        counts["correct"] += row["correct"]
        cell = ("TP" if row["prediction"] else "FN") if row["label"] else ("FP" if row["prediction"] else "TN")
        counts[cell] += 1
        counts["squaredUnderflow"] += row["squaredUnderflow"]
        if row["absoluteResidual"] > maximum:
            maximum = row["absoluteResidual"]
        partials.append(dict(id=identifier, before=before,
            operands=dict(square=row["square"], correct=row["correct"], label=row["label"],
                          prediction=row["prediction"], absoluteResidual=row["absoluteResidual"],
                          squaredUnderflow=row["squaredUnderflow"]),
            after=dict(counts, SSE=sse, maxAbsoluteResidual=maximum)))
    result = dict(counts, ids=list(ids), SSE=sse, maxAbsoluteResidual=maximum, partials=partials,
                  precisionDenominator=counts["TP"] + counts["FP"],
                  recallDenominator=counts["TP"] + counts["FN"], unavailable={})
    if counts["n"]:
        result["accuracy"] = _finite(counts["correct"] / counts["n"])
        result["brier"] = _finite(sse / counts["n"])
    else:
        result["unavailable"].update(accuracy="No retained items.", brier="No retained items.")
    for metric, denominator in (("precision", result["precisionDenominator"]), ("recall", result["recallDenominator"])):
        if denominator:
            result[metric] = _finite(counts["TP"] / denominator)
        else:
            result["unavailable"][metric] = "No predicted positives." if metric == "precision" else "No actual positives."
    return result


def _bins(rows, ids):
    bins, aggregate, maximum, underflow, contributions = [], 0.0, 0.0, 0, []
    for index in (0, 1):
        members = [identifier for identifier in ids if rows[identifier]["bin"] == index]
        sum_p, sum_y, partials = 0.0, 0.0, []
        for identifier in members:
            row = rows[identifier]
            before_p, before_y = sum_p, sum_y
            before_n = len(partials)
            sum_p = _finite(sum_p + row["effectiveP"])
            sum_y = _finite(sum_y + row["labelOperand"])
            partials.append(dict(id=identifier, beforeN=before_n, afterN=before_n + 1, beforeP=before_p, beforeY=before_y,
                p=row["effectiveP"], y=row["labelOperand"], afterP=sum_p, afterY=sum_y))
        current = dict(index=index, lower=0.0 if index == 0 else .5,
            upper=.5 if index == 0 else 1.0, upperInclusive=index,
            ids=members, n=len(members), sumP=sum_p, sumY=sum_y, partials=partials,
            initial=dict(n=0, sumP=0.0, sumY=0.0))
        if members:
            mean = _finite(sum_p / len(members))
            observed = _finite(sum_y / len(members))
            signed = _finite(mean - observed)
            absolute = abs(signed)
            weight = _finite(len(members) / len(ids))
            contribution = _finite(weight * absolute)
            rounded_underflow = int(absolute != 0.0 and contribution == 0.0)
            current.update(meanP=mean, observedPositiveFraction=observed, signedGap=signed,
                absoluteGap=absolute, weight=weight, contribution=contribution,
                contributionUnderflow=rounded_underflow)
            previous, previous_maximum, previous_underflow = aggregate, maximum, underflow
            aggregate = _finite(aggregate + contribution)
            contributions.append(dict(bin=index, before=previous, contribution=contribution, after=aggregate))
            if absolute > maximum:
                maximum = absolute
            underflow += rounded_underflow
            current.update(previousAggregate=previous, previousMaxAbsoluteBinGap=previous_maximum,
                previousContributionUnderflowCount=previous_underflow, aggregate=aggregate,
                maxAbsoluteBinGap=maximum, contributionUnderflowCount=underflow)
        else:
            current["unavailable"] = "No retained items in this probability bin; means, gaps, weight and contribution were not computed."
        bins.append(current)
    result = dict(bins=bins, contributions=contributions, aggregate=aggregate,
                  maximum=maximum, underflow=underflow)
    if ids:
        result.update(calibration=aggregate, maxAbsoluteBinGap=maximum, contributionUnderflow=underflow)
    else:
        result["unavailable"] = "No retained items; calibration aggregate and gap maximum are absent."
    return result


def _leave_one_out(rows, ids):
    if len(ids) < 2:
        return dict(unavailable="At least two retained items are needed for deletion sensitivity.")
    omissions = []
    for omitted in ids:
        retained = [identifier for identifier in ids if identifier != omitted]
        # Fresh folds reuse captured rows; neither forecast nor cutoff is changed.
        folded = _fold(rows, retained)
        omissions.append(dict(omitted=omitted, retained=retained, n=folded["n"],
            correct=folded["correct"], SSE=folded["SSE"], partials=folded["partials"],
            accuracy=folded["accuracy"], brier=folded["brier"]))
    endpoints, selections = {}, {}
    for metric in ("accuracy", "brier"):
        minimum = maximum = omissions[0]
        selections[metric] = []
        for candidate in omissions[1:]:
            before_minimum, before_maximum = minimum, maximum
            if candidate[metric] < minimum[metric]:
                minimum = candidate
            if candidate[metric] > maximum[metric]:
                maximum = candidate
            selections[metric].append(dict(omitted=candidate["omitted"], value=candidate[metric],
                beforeMinimum=before_minimum[metric], beforeMaximum=before_maximum[metric],
                afterMinimum=minimum[metric], afterMaximum=maximum[metric],
                minimumOmission=minimum["omitted"], maximumOmission=maximum["omitted"]))
        endpoints[metric] = dict(minimum=minimum[metric], minimumOmission=minimum["omitted"],
                                 maximum=maximum[metric], maximumOmission=maximum["omitted"])
    public_endpoints, public_ids, selection_states = {}, {}, []
    for omission in omissions:
        previous = dict(public_endpoints, **public_ids)
        for metric in ("accuracy", "brier"):
            for suffix, better in (("Min", True), ("Max", False)):
                key = metric + suffix
                if (key not in public_endpoints or
                        (omission[metric] < public_endpoints[key] if better else omission[metric] > public_endpoints[key])):
                    public_endpoints[key] = omission[metric]
                    public_ids[key + "Id"] = omission["omitted"]
        selection_states.append(dict(before=previous, after=dict(public_endpoints, **public_ids)))
    return dict(omissions=omissions, endpoints=endpoints, selections=selections,
                publicEndpoints=public_endpoints, publicIds=public_ids, selectionStates=selection_states)


def _first(value, prefix):
    """Independent scalar capture, with storage consumed before downstream work."""
    state = reliability_state(value)
    _support._prefix(prefix)
    exposures, effective = [], []
    for identifier, label in enumerate(_LABELS):
        base, label_operand = state["p" + str(identifier)], float(label)
        row = dict(id=identifier, label=label, labelOperand=label_operand,
                   baseP=base, exposed=int(identifier < state["m"]))
        if row["exposed"]:
            delta = _finite(label_operand - base)
            taint = _finite(state["blend"] * delta)
            probability = _finite(base + taint)
            row.update(blend=state["blend"], delta=delta, taint=taint)
        else:
            probability = base
            row["unavailable"] = "Unexposed row: delta, taint and addition branch did not run; base probability was copied."
        row["storageInput"] = probability
        effective.append(probability)
        exposures.append(row)
    stored = _support._storage(effective, 6, 1)
    # Read ALL six actual indexed words before decisions, residuals or reductions.
    consumed = [float(stored[0, identifier, 0]) for identifier in range(6)]
    rows = []
    for identifier, probability in enumerate(consumed):
        row = dict(exposures[identifier], effectiveP=probability, tau=state["tau"])
        prediction = int(probability >= state["tau"])
        residual = _finite(probability - row["labelOperand"])
        square = _finite(residual * residual)
        row.update(prediction=prediction, correct=int(prediction == row["label"]),
                   residual=residual, square=square, absoluteResidual=abs(residual),
                   squaredUnderflow=int(residual != 0.0 and square == 0.0),
                   bin=0 if probability < .5 else 1)
        rows.append(row)
    cohorts = {}
    for name, ids in (("full", list(range(6))), ("clean", list(range(state["m"], 6)))):
        cohorts[name] = dict(firstId=0 if name == "full" else state["m"], sourceCount=6,
            initial=dict(n=0, correct=0, TP=0, FN=0, FP=0, TN=0, SSE=0.0,
                maxAbsoluteResidual=0.0, squareUnderflowCount=0, calibrationSum=0.0,
                maxAbsoluteBinGap=0.0, contributionUnderflowCount=0),
            statistics=_fold(rows, ids), calibration=_bins(rows, ids), deletion=_leave_one_out(rows, ids))
    return _freeze(dict(state=state, rows=rows, cohorts=cohorts))


def _tensor(identifier, shape, axes, values, provenance, dtype="float64"):
    """Internal adopted tensor7: copy saved words; no numeric computation."""
    return dict(id=identifier, shape=list(shape), axes=list(axes), dtype=dtype,
                values=list(values), provenance=provenance, precision=0 if dtype == "int32" else 8)


def _counts(record):
    return {key: record[source] for key, source in (
        ("n", "n"), ("correct", "correct"), ("TP", "TP"), ("FN", "FN"),
        ("FP", "FP"), ("TN", "TN"), ("SSE", "SSE"),
        ("maxAbsoluteResidual", "maxAbsoluteResidual"), ("squareUnderflowCount", "squaredUnderflow"))}


def _project(saved, trace, prefix):
    """Functional projection AFTER full private capture, not instruction interception."""
    state, rows = saved["state"], saved["rows"]
    summary = {}
    texts = dict(
        rawFields=list(_FIELDS),
        prompts=['2+2', '2+3', '3+3', '3+4', '4+4', '4+5'],
        candidates=['4', '6', '7', '7', '8', '10'],
        correctAnswers=['4', '5', '6', '7', '8', '9'],
        rubric='For every item, the supplied candidate must equal the exact correct integer for the disclosed addition.',
        rowWordFields=['baseP', 'labelOperand', 'effectiveP', 'tau', 'residual', 'square', 'absoluteResidual'],
        rowDecisionFields=['id', 'label', 'exposed', 'prediction', 'correct', 'squareUnderflow', 'bin'],
        exposureFields=['labelOperand', 'delta', 'taint', 'effectiveP'],
        countFields=['n', 'correct', 'TP', 'FN', 'FP', 'TN', 'predictedPositive', 'actualPositive', 'squareUnderflowCount', 'contributionUnderflowCount'],
        statisticFields=['SSE', 'maxAbsoluteResidual'], binSumFields=['sumP', 'sumY'],
        binMetricFields=['meanP', 'observedFraction', 'signedGap', 'absoluteGap', 'weight', 'contribution'],
        calibrationFields=['calibrationGap', 'maxAbsoluteBinGap'],
        looScoreFields=['SSE', 'accuracy', 'brier'], looCountFields=['n', 'correct'],
        endpointFields=['accuracyMin', 'accuracyMax', 'brierMin', 'brierMax'],
        cohortOrder=['full', 'clean'], binLabels=['[0,0.5)', '[0.5,1]'],
        inputPolicy='Exact own-data raw9 on a plain/null-prototype record: acquire all descriptors, inspect all descriptors, check all finite numbers, check domains in raw order, then ASCII prefix. No coercion, default merging, clipping, accessor execution or inactive-blend bypass. Only m is VALUE and normalizes either zero sign to integer0.',
        exposurePolicy='Exposure means original id<m in fictional preparation material. Exposed rows separately subtract labelOperand-baseP, multiply blend*delta, then add baseP+taint, even at blend0 or1. Unexposed rows copy the base word and omit all three branch results with a saved reason.',
        metricPolicy='FULL IDs0..5 and CLEAN IDs m..5 reuse the same captured rows. Fresh ascending-ID +0 SSE folds and integer counts precede accuracy=correct/n and one-probability binary Brier=SSE/n. Precision=TP/(TP+FP); recall=TP/(TP+FN). Omit every zero-denominator metric with its saved availability reason.',
        calibrationPolicy='Fixed class1 bins [0,0.5),[0.5,1], independent of tau. Fresh ascending-ID +0 sumP and sumY; separately divide each by bin count, subtract actual means, take abs, divide bin count by cohort count, multiply weight*absoluteGap, then fold occupied contributions in low/high order from +0. Empty-bin means and products do not exist.',
        deletionPolicy='For n>=2 omit each retained original ID ascending, freshly fold the other captured squares and correctness ascending, then divide by n-1. Never subtract an omitted square from a rounded total or alter forecasts. Strict endpoint improvements preserve the first omission ID on ties; endpoint words copy actual saved scores. These are descriptive deletion ranges, not confidence intervals.',
        zeroPolicy='All float inputs, label operands, arithmetic, partials, metrics, boundaries and copies are WORD including -0. IDs, labels, exposure/prediction/correct/bin/underflow flags and counts are VALUE. abs(-0)=+0. Exposed blend0 need not preserve a base -0; unexposed copies do. Display precision never changes comparisons or arithmetic.',
        underflowPolicy='A nonzero residual whose square rounds to zero retains its residual, absolute residual and flag. Occupied-bin weight and absolute gap whose product rounds to zero retain the gap and contribution-underflow flag. Preserve maxima and counts; rounded Brier0 or calibration0 does not certify exact identity or reliability.',
        provenance='Six self-authored arithmetic prompt/candidate/rubric items and hand-set class1 forecasts. No generated answer, model call, training, IID sample, real overlap detector or measured benchmark. Cleaning changes cohort membership, not a causal estimate of contamination.',
        limitsPolicy='No elementary native, clock, numerical derivative, training, fitting or random draw. Scores describe this curated table only. Calibration, accuracy, forecast error and population reliability are different questions. All runtime validation remains deferred under the FluxGeo hold.')
    trace.add(prefix + '_raw', 'Capture the complete evaluation state', 'raw=[p0,p1,p2,p3,p4,p5,tau,m,blend]',
        'All nine fields have passed descriptors, finite checks and domains before this record or any exposure branch. Preserve eight float words; m is a normalized discrete count.',
        dict(state), dict(state))
    for row in rows:
        identifier = row['id']
        if row['exposed']:
            texts[f'row{identifier}ExposureAvailability'] = 'Defined: id<m; subtraction, multiplication and addition all executed.'
            trace.add(f'{prefix}_exposure_{identifier}', f'Expose answer-key blend for item {identifier}', 'delta=labelOperand-baseP; taint=blend*delta; effectiveP=baseP+taint',
                'Three separate finite binary64 primitives execute in this order. Do not skip zero blend, copy the label at blend1, reassociate or contract the operations.',
                {key: row[key] for key in ('id', 'labelOperand', 'baseP', 'blend')},
                {key: row[key] for key in ('delta', 'taint', 'effectiveP')})
        else:
            texts[f'row{identifier}ExposureAvailability'] = 'Unavailable: id>=m; delta, taint and exposure addition did not execute. effectiveP copies baseP WORD.'
            trace.add(f'{prefix}_copy_{identifier}', f'Copy unexposed forecast for item {identifier}', 'effectiveP=baseP WORD copy',
                'The exposure branch is absent. No delta, taint or exposure-addition result is manufactured, including at blend0.',
                dict(id=identifier, baseP=row['baseP']), dict(effectiveP=row['effectiveP']))
        trace.add(f'{prefix}_row_{identifier}', f'Score saved forecast for item {identifier}', 'prediction=(effectiveP>=tau); correct=(prediction===label); residual=effectiveP-labelOperand; square=residual*residual; absoluteResidual=abs(residual); bin=(effectiveP<0.5?0:1)',
            'Use represented inclusive threshold ties and fixed probability bins. A nonzero residual with rounded square0 remains visible through its underflow flag; no epsilon or display rounding is used.',
            {key: row[key] for key in ('id', 'label', 'labelOperand', 'effectiveP', 'tau')},
            dict(prediction=row['prediction'], correct=row['correct'], residual=row['residual'], square=row['square'],
                 absoluteResidual=row['absoluteResidual'], squareUnderflow=row['squaredUnderflow'], bin=row['bin']))
    tensors = [
        _tensor(prefix + '_Raw', [9], ['RawField'], list(state.values()), 'Captured raw9 in declared order; m is VALUE, all other cells WORD.'),
        _tensor(prefix + '_Labels', [6], ['Item'], _LABELS, 'Fixed disclosed rubric labels in original ID order0..5.', 'int32'),
        _tensor(prefix + '_Rows', [6, 7], ['Item', 'RowWordField'], [row[key] for row in rows for key in texts['rowWordFields']], 'Actual saved baseP,labelOperand,effectiveP,tau,residual,square,absoluteResidual words per original item.'),
        _tensor(prefix + '_RowDecisions', [6, 7], ['Item', 'RowDecisionField'], [row[source] for row in rows for source in ('id', 'label', 'exposed', 'prediction', 'correct', 'squaredUnderflow', 'bin')], 'Actual id,label,exposed,prediction,correct,squareUnderflow,bin VALUE fields per original item.', 'int32'),
    ]
    if state['m'] > 0:
        tensors.append(_tensor(prefix + '_Exposure', [state['m'], 4], ['ExposedItem', 'ExposureField'],
            [row[key] for row in rows if row['exposed'] for key in texts['exposureFields']], 'Actually executed labelOperand,delta,taint,effectiveP words for exposed IDs0..m-1 only.'))
    texts['exposureTensorAvailability'] = 'Defined: exposed branch words exist for IDs0..m-1.' if state['m'] > 0 else 'Unavailable: m=0; no exposure branch or exposure tensor exists.'
    for cohort in ('full', 'clean'):
        captured = saved['cohorts'][cohort]
        stats, calibration, deletion = captured['statistics'], captured['calibration'], captured['deletion']
        ids, n = stats['ids'], stats['n']
        stem, title = prefix + '_' + cohort, 'Full cohort' if cohort == 'full' else 'Clean cohort'
        texts[cohort + 'MemberIds'] = [str(identifier) for identifier in ids]
        texts[cohort + 'MembershipAvailability'] = 'Defined: retained original IDs in ascending order.' if n > 0 else 'Unavailable: no clean items remain; member tensor is omitted.'
        trace.add(stem + '_start', title + ': fresh accumulators', 'integer counts=0; SSE=+0; maxima=+0; calibrationSum=+0',
            'Start independent reductions from literal zeros. Empty cohorts retain these real count/sum initializers but have no means, rates, calibration score or deletion endpoints.',
            dict(firstId=captured['firstId'], sourceCount=captured['sourceCount']), dict(captured['initial']))
        for partial in stats['partials']:
            identifier, before, operand = partial['id'], partial['before'], partial['operands']
            trace.add(f'{stem}_fold_{identifier}', f'{title}: retain item {identifier}', 'n=previousN+1; correct=previousCorrect+rowCorrect; increment one confusion cell; SSE=previousSSE+square; maxAbs=strict maximum',
                'Visit retained original IDs ascending. Counts are exact integer VALUE; the SSE addition and maximum copy retain actual WORDs. No excluded item contributes.',
                dict(id=identifier, label=operand['label'], prediction=operand['prediction'], rowCorrect=operand['correct'], square=operand['square'], absoluteResidual=operand['absoluteResidual'], squareUnderflow=operand['squaredUnderflow'],
                     previousN=before['n'], previousCorrect=before['correct'], previousTP=before['TP'], previousFN=before['FN'], previousFP=before['FP'], previousTN=before['TN'], previousSSE=before['SSE'], previousMaxAbsoluteResidual=before['maxAbsoluteResidual'], previousSquareUnderflowCount=before['squaredUnderflow']),
                _counts(partial['after']))
        metrics = {key: stats[key] for key in ('accuracy', 'brier', 'precision', 'recall') if key in stats}
        texts[cohort + 'AccuracyAvailability'] = 'Defined: correct/n with n>0.' if n > 0 else 'Unavailable: n=0; accuracy has no denominator.'
        texts[cohort + 'BrierAvailability'] = 'Defined: SSE/n with n>0.' if n > 0 else 'Unavailable: n=0; Brier has no denominator.'
        texts[cohort + 'PrecisionAvailability'] = 'Defined: TP/(TP+FP) with predictedPositive>0.' if stats['precisionDenominator'] > 0 else 'Unavailable: TP+FP=0; there are no predicted positives.'
        texts[cohort + 'RecallAvailability'] = 'Defined: TP/(TP+FN) with actualPositive>0.' if stats['recallDenominator'] > 0 else 'Unavailable: TP+FN=0; there are no actual positives.'
        trace.add(stem + '_metrics', title + ': available score divisions', 'predictedPositive=TP+FP; actualPositive=TP+FN; accuracy=correct/n; brier=SSE/n; precision=TP/predictedPositive; recall=TP/actualPositive, only for positive denominators',
            'Omit each undefined division independently and save its specific reason. A defined zero is retained; no null, NaN, epsilon denominator or fake score fills an absent metric.',
            {key: stats[key] for key in ('n', 'correct', 'TP', 'FN', 'FP', 'TN', 'SSE')},
            dict(predictedPositive=stats['precisionDenominator'], actualPositive=stats['recallDenominator'], **metrics))
        bin_tensors = []
        for current in calibration['bins']:
            index, bin_n = current['index'], current['n']
            bin_stem = f'{stem}_bin{index}'
            texts[f'{cohort}Bin{index}MemberIds'] = [str(identifier) for identifier in current['ids']]
            trace.add(bin_stem + '_start', f'{title}: initialize probability bin {index}', 'binCount=0; sumP=+0; sumY=+0',
                'Bins are fixed class1 probability intervals, independent of the decision cutoff. The exact half belongs to the upper bin; start fresh ordered sums even when the bin is empty.',
                dict(bin=index, lower=current['lower'], upper=current['upper'], upperInclusive=current['upperInclusive']), dict(current['initial']))
            for partial in current['partials']:
                trace.add(f"{bin_stem}_fold_{partial['id']}", f"{title}: bin {index} retains item {partial['id']}", 'n=previousN+1; sumP=previousSumP+effectiveP; sumY=previousSumY+labelOperand',
                    'Use the captured effective probability and floating label operand in ascending original ID order. These are two separate additions from their own fresh +0 folds.',
                    dict(id=partial['id'], previousN=partial['beforeN'], previousSumP=partial['beforeP'], effectiveP=partial['p'], previousSumY=partial['beforeY'], labelOperand=partial['y']),
                    dict(n=partial['afterN'], sumP=partial['afterP'], sumY=partial['afterY']))
            bin_tensors.extend([
                _tensor(bin_stem + '_Count', [1], ['Count'], [bin_n], 'Actual retained bin count, including a real empty-bin zero.', 'int32'),
                _tensor(bin_stem + '_Sums', [2], ['BinSumField'], [current['sumP'], current['sumY']], 'Fresh ascending-ID +0 sumP,sumY; empty-bin sums retain their actual +0 initializers.')])
            if bin_n > 0:
                bin_metrics = dict(meanP=current['meanP'], observedFraction=current['observedPositiveFraction'], signedGap=current['signedGap'], absoluteGap=current['absoluteGap'], weight=current['weight'], contribution=current['contribution'])
                trace.add(bin_stem + '_finish', f'{title}: score occupied bin {index}', 'meanP=sumP/binN; observedFraction=sumY/binN; signedGap=meanP-observedFraction; absoluteGap=abs(signedGap); weight=binN/cohortN; contribution=weight*absoluteGap; aggregate=previousAggregate+contribution',
                    'Each division, subtraction, absolute value, multiplication and aggregate addition saves its actual operands/results in this order. Fold occupied bins low then high; retain gap maxima and rounded-contribution underflow evidence.',
                    dict(binN=bin_n, cohortN=n, sumP=current['sumP'], sumY=current['sumY'], previousAggregate=current['previousAggregate'], previousMaxAbsoluteBinGap=current['previousMaxAbsoluteBinGap'], previousContributionUnderflowCount=current['previousContributionUnderflowCount']),
                    dict(bin_metrics, contributionUnderflow=current['contributionUnderflow'], aggregate=current['aggregate'], maxAbsoluteBinGap=current['maxAbsoluteBinGap'], contributionUnderflowCount=current['contributionUnderflowCount']))
                bin_tensors.extend([
                    _tensor(bin_stem + '_MemberIds', [bin_n], ['BinItem'], current['ids'], 'Retained original IDs in this occupied bin, ascending.', 'int32'),
                    _tensor(bin_stem + '_Metrics', [6], ['BinMetricField'], list(bin_metrics.values()), 'Actual meanP,observedFraction,signedGap,absoluteGap,weight,contribution words; no algebraic reassociation.')])
                texts[f'{cohort}Bin{index}Availability'] = 'Defined: binN>0; both means, signed/absolute gap, weight and contribution exist.'
            else:
                trace.add(bin_stem + '_finish', f'{title}: empty bin {index}', 'copy actual count and sum initializers; omit all bin means and contribution',
                    'No bin members means no mean, observed fraction, gap, weight or contribution. No aggregate addition executes for this bin and no empty-shape member/metric tensor is created.',
                    dict(binN=bin_n, cohortN=n, sumP=current['sumP'], sumY=current['sumY']), dict(n=bin_n, sumP=current['sumP'], sumY=current['sumY']))
                texts[f'{cohort}Bin{index}Availability'] = 'Unavailable: binN=0; member tensor, means, observed fraction, signed/absolute gap, weight and contribution are omitted; no aggregate term executed.'
        calibration_outputs = dict(calibrationGap=calibration['aggregate'], maxAbsoluteBinGap=calibration['maximum'], contributionUnderflowCount=calibration['underflow']) if n > 0 else dict(contributionUnderflowCount=calibration['underflow'])
        trace.add(stem + '_calibration', title + ': saved calibration evidence', 'copy final occupied-bin fold and maximum only when n>0',
            'A zero rounded aggregate is separate from maximum gap and underflow evidence. Empty cohorts have no calibration score, even though their initialized fold/counts remain saved.',
            dict(n=n, aggregate=calibration['aggregate'], maxAbsoluteBinGap=calibration['maximum'], contributionUnderflowCount=calibration['underflow']), calibration_outputs)
        texts[cohort + 'CalibrationAvailability'] = 'Defined: separately rounded occupied-bin weight/product/fold.' if n > 0 else 'Unavailable: n=0; no calibration score or maximum-gap metric exists.'
        loo_tensors, endpoints, endpoint_ids = [], {}, {}
        if n >= 2:
            endpoints, endpoint_ids = deletion['publicEndpoints'], deletion['publicIds']
            for omission, selection in zip(deletion['omissions'], deletion['selectionStates']):
                omitted = omission['omitted']
                for partial in omission['partials']:
                    before = partial['before']
                    trace.add(f"{stem}_loo_{omitted}_fold_{partial['id']}", f"{title}: omit {omitted}, retain {partial['id']}", 'n=previousN+1; correct=previousCorrect+rowCorrect; SSE=previousSSE+square',
                        'A fresh +0 SSE and integer correctness fold visits all other retained IDs ascending. Reuse fixed captured squares/decisions; never subtract from a rounded total, refit or change the threshold.',
                        dict(omittedId=omitted, id=partial['id'], previousN=before['n'], previousCorrect=before['correct'], previousSSE=before['SSE'], rowCorrect=partial['operands']['correct'], square=partial['operands']['square']),
                        {key: partial['after'][key] for key in ('n', 'correct', 'SSE')})
                trace.add(f'{stem}_loo_{omitted}_metrics', f'{title}: scores omitting {omitted}', 'accuracy=correct/n; brier=SSE/n',
                    'Divide the final fresh retained sums by their positive n-1 count. These words are the actual candidates for the descriptive endpoint comparisons.',
                    dict(omittedId=omitted, n=omission['n'], correct=omission['correct'], SSE=omission['SSE']),
                    dict(accuracy=omission['accuracy'], brier=omission['brier']))
                trace.add(f'{stem}_loo_{omitted}_select', f'{title}: compare omission {omitted} endpoints', 'first candidate initializes all endpoints; later replace only on strict improvement',
                    'Compare actual saved score words in increasing omission-ID order. Exact ties retain the first original omission ID; endpoint values copy saved candidates without a new division.',
                    dict(omittedId=omitted, accuracy=omission['accuracy'], brier=omission['brier'], **selection['before']), dict(selection['after']))
            loo_tensors.extend([
                _tensor(stem + '_OmissionIds', [n], ['Omission'], [o['omitted'] for o in deletion['omissions']], 'All omitted original IDs in ascending order.', 'int32'),
                _tensor(stem + '_LooScores', [n, 3], ['Omission', 'LooScoreField'], [o[key] for o in deletion['omissions'] for key in ('SSE', 'accuracy', 'brier')], 'Actual fresh retained SSE,accuracy,brier words for each omission, in omission-ID order.'),
                _tensor(stem + '_LooCounts', [n, 2], ['Omission', 'LooCountField'], [o[key] for o in deletion['omissions'] for key in ('n', 'correct')], 'Actual retained n,correct integer folds for every omission.', 'int32'),
                _tensor(stem + '_Endpoints', [4], ['Endpoint'], list(endpoints.values()), 'Copied actual accuracyMin,accuracyMax,brierMin,brierMax words; descriptive deletion sensitivity only.'),
                _tensor(stem + '_EndpointIds', [4], ['Endpoint'], list(endpoint_ids.values()), 'First original omission ID attaining each accuracyMin,accuracyMax,brierMin,brierMax endpoint.', 'int32')])
            texts[cohort + 'LooAvailability'] = 'Defined: n>=2; fresh folds for every omission and strict first-ID endpoint selection.'
        else:
            trace.add(stem + '_looUnavailable', title + ': deletion distribution unavailable', 'omissionCount=0; no deletion score or endpoint exists',
                'For zero or one retained item, removing an item cannot leave a nonempty scoring cohort. No deletion division, endpoint copy or empty-shape deletion tensor is created.', dict(n=n), dict(omissionCount=0))
            texts[cohort + 'LooAvailability'] = 'Unavailable: n=0; no items exist to omit.' if n == 0 else 'Unavailable: n=1; deletion leaves no scoring items.'
        counts = dict(n=n, correct=stats['correct'], TP=stats['TP'], FN=stats['FN'], FP=stats['FP'], TN=stats['TN'], predictedPositive=stats['precisionDenominator'], actualPositive=stats['recallDenominator'], squareUnderflowCount=stats['squaredUnderflow'], contributionUnderflowCount=calibration['underflow'])
        if n > 0:
            tensors.append(_tensor(stem + '_MemberIds', [n], ['CohortItem'], ids, 'Retained original IDs in ascending order; full0..5 or clean m..5.', 'int32'))
        tensors.extend([
            _tensor(stem + '_Counts', [10], ['CountField'], list(counts.values()), 'Actual n,correct,TP,FN,FP,TN,predictedPositive,actualPositive,squareUnderflowCount,contributionUnderflowCount VALUE fields.', 'int32'),
            _tensor(stem + '_Statistics', [2], ['StatisticField'], [stats['SSE'], stats['maxAbsoluteResidual']], 'Actual ordered SSE and maxAbsoluteResidual accumulator words; empty-cohort values are literal +0 initializers, not means.')])
        for key, word in metrics.items():
            tensors.append(_tensor(stem + '_' + key, [1], ['Metric'], [word], f'Actual saved {key} division word; this tensor exists only with a positive denominator.'))
        tensors.extend(bin_tensors)
        if n > 0:
            tensors.append(_tensor(stem + '_Calibration', [2], ['CalibrationField'], [calibration['aggregate'], calibration['maximum']], 'Actual final occupied-bin contribution fold and maximum absolute gap words; no empty-cohort placeholder.'))
        tensors.extend(loo_tensors)
        for key, word in (('Count', n), ('Correct', stats['correct']), ('TP', stats['TP']), ('FN', stats['FN']), ('FP', stats['FP']), ('TN', stats['TN']), ('PredictedPositive', stats['precisionDenominator']), ('ActualPositive', stats['recallDenominator']), ('SSE', stats['SSE']), ('MaxAbsoluteResidual', stats['maxAbsoluteResidual']), ('SquareUnderflowCount', stats['squaredUnderflow']), ('ContributionUnderflowCount', calibration['underflow'])):
            summary[cohort + key] = word
        for key, word in metrics.items():
            summary[cohort + key[0].upper() + key[1:]] = word
        if n > 0:
            summary[cohort + 'CalibrationGap'] = calibration['aggregate']
            summary[cohort + 'MaxAbsoluteBinGap'] = calibration['maximum']
        for key, word in list(endpoints.items()) + list(endpoint_ids.items()):
            summary[cohort + key[0].upper() + key[1:]] = word
    return _freeze(dict(state=state, summary=summary, tensors=tensors, texts=texts))


def evaluate_reliability(value, trace, prefix):
    """Compute once independently, then expose saved words through trusted callbacks."""
    return _project(_first(value, prefix), trace, prefix)



def check_mechanism():
    if not __debug__:
        raise RuntimeError("Explicit IV65 mechanism check refuses optimized Python (-O).")
    result = _first(dict(DEFAULT_IV65), "first")
    rows, full = result["rows"], result["cohorts"]["full"]
    assert [r["residual"] for r in rows] == [-.25, .25, .75, -.75, -.5, .5]
    assert [r["square"] for r in rows] == [.0625, .0625, .5625, .5625, .25, .25]
    stats = full["statistics"]
    assert [p["after"]["SSE"] for p in stats["partials"]] == [.0625, .125, .6875, 1.25, 1.5, 1.75]
    assert (stats["TP"], stats["FN"], stats["FP"], stats["TN"], stats["correct"]) == (2, 1, 2, 1, 3)
    assert (stats["accuracy"], stats["brier"], stats["precision"], stats["recall"]) == (.5, 7 / 24, .5, 2 / 3)
    assert result["cohorts"]["clean"]["statistics"] == full["statistics"]
    assert result["cohorts"]["clean"]["calibration"] == full["calibration"]
    assert result["cohorts"]["clean"]["deletion"] == full["deletion"]
    lower, upper = full["calibration"]["bins"]
    assert (lower["ids"], lower["sumP"], lower["sumY"], lower["signedGap"]) == ([1, 3], .5, 1., -.25)
    assert (upper["ids"], upper["sumP"], upper["sumY"], upper["signedGap"]) == ([0, 2, 4, 5], 2.5, 2., .125)
    assert full["calibration"]["calibration"] == (2 / 6) * .25 + (4 / 6) * .125
    deletion = full["deletion"]
    assert [o["SSE"] for o in deletion["omissions"]] == [1.6875, 1.6875, 1.1875, 1.1875, 1.5, 1.5]
    assert deletion["endpoints"]["accuracy"] == dict(minimum=2 / 5, minimumOmission=0, maximum=3 / 5, maximumOmission=2)
    assert deletion["endpoints"]["brier"] == dict(minimum=19 / 80, minimumOmission=2, maximum=27 / 80, maximumOmission=0)
    changed = _first(dict(DEFAULT_IV65, m=4, blend=1), "changed")["cohorts"]
    assert changed["full"]["statistics"]["accuracy"] == 5 / 6
    assert changed["full"]["statistics"]["brier"] == 1 / 12
    assert changed["clean"]["statistics"]["brier"] == .25
    assert changed["clean"]["deletion"]["endpoints"]["accuracy"]["minimum"] == 0.
    assert changed["clean"]["deletion"]["endpoints"]["accuracy"]["maximum"] == 1.
    selected = _first(dict(DEFAULT_IV65, m=2), "selected")["cohorts"]["clean"]["statistics"]
    assert (selected["accuracy"], selected["brier"]) == (.25, 13 / 32)
    singleton = _first(dict(DEFAULT_IV65, m=5), "singleton")["cohorts"]["clean"]
    assert singleton["statistics"]["precision"] == 0.
    assert "recall" not in singleton["statistics"] and "recall" in singleton["statistics"]["unavailable"]
    assert "omissions" not in singleton["deletion"]
    empty = _first(dict(DEFAULT_IV65, m=6, blend=1), "empty")["cohorts"]["clean"]
    assert empty["statistics"]["n"] == 0 and empty["statistics"]["SSE"] == 0.
    assert "brier" not in empty["statistics"] and "calibration" not in empty["calibration"]
    assert "omissions" not in empty["deletion"]
    half = dict(DEFAULT_IV65)
    for key in _FIELDS[:6]:
        half[key] = .5
    constant = _first(half, "half")["cohorts"]["full"]
    assert constant["statistics"]["accuracy"] == .5 and constant["statistics"]["brier"] == .25
    assert constant["calibration"]["calibration"] == 0.
    assert "meanP" not in constant["calibration"]["bins"][0]
    for key in _FIELDS[:6]:
        half[key] = .75
    constant = _first(half, "threequarters")["cohorts"]["full"]
    assert constant["statistics"]["accuracy"] == .5 and constant["statistics"]["brier"] == 5 / 16
    assert constant["calibration"]["calibration"] == .25
    low = _first(dict(DEFAULT_IV65, tau=0), "low")["cohorts"]["full"]
    high = _first(dict(DEFAULT_IV65, tau=1), "high")["cohorts"]["full"]
    assert low["statistics"]["recall"] == 1. and high["statistics"]["recall"] == 0.
    assert "precision" not in high["statistics"]
    assert low["statistics"]["brier"] == high["statistics"]["brier"] == stats["brier"]
    assert low["calibration"] == high["calibration"] == full["calibration"]


def check_guards_and_words():
    if not __debug__:
        raise RuntimeError("Explicit IV65 guard/WORD check refuses optimized Python (-O).")
    frozen_state = reliability_state(DEFAULT_IV65)
    assert type(DEFAULT_IV65) is _support._FrozenDict and type(frozen_state) is _support._FrozenDict
    assert _first(DEFAULT_IV65, "default") == _first(dict(DEFAULT_IV65), "ordinary")
    assert _first(frozen_state, "detached") == _first(DEFAULT_IV65, "default")

    class DictSubtype(dict):
        pass

    class SupportSubtype(_support._FrozenDict):
        pass

    class ForeignFrozen(dict):
        pass

    for foreign in (DictSubtype(DEFAULT_IV65), SupportSubtype(DEFAULT_IV65), ForeignFrozen(DEFAULT_IV65)):
        try:
            reliability_state(foreign)
        except NumericalFault as error:
            assert type(error) is NumericalFault and error.code == "INVALID_INPUT"
        else:
            raise AssertionError("Only exact dict and this support module's exact frozen dict are admitted.")
    for state in (dict(DEFAULT_IV65, p0=2, blend=float("inf")),
                  dict(DEFAULT_IV65, p0=2, m=True), dict(DEFAULT_IV65, p0=2, p5=10**1000)):
        try:
            _first(state, "bad-prefix")
        except NumericalFault as error:
            assert type(error) is NumericalFault and error.code == "NONFINITE"
        else:
            raise AssertionError("Every finite check must precede every domain and prefix.")
    for state in ({}, dict(DEFAULT_IV65, extra=0), dict(DEFAULT_IV65, p0=2, m=.5),
                  dict(DEFAULT_IV65, m=.5), dict(DEFAULT_IV65, blend=-.1)):
        try:
            _first(state, "bad-prefix")
        except NumericalFault as error:
            assert error.code == "INVALID_INPUT"
            assert "prefix" not in error.reason
        else:
            raise AssertionError("Invalid raw input must precede the prefix.")
    try:
        _first(dict(DEFAULT_IV65), "é")
    except NumericalFault as error:
        assert error.code == "INVALID_INPUT" and "prefix" in error.reason
    else:
        raise AssertionError("Prefix is ASCII only.")
    zero = _first(dict(DEFAULT_IV65, p1=-0.0, tau=-0.0, m=-0.0), "zero")
    assert type(zero["state"]["m"]) is int and zero["state"]["m"] == 0
    for value in (zero["state"]["p1"], zero["state"]["tau"], zero["rows"][1]["effectiveP"], zero["rows"][1]["residual"]):
        assert math.copysign(1., value) == -1.
    assert zero["rows"][1]["prediction"] == 1
    assert math.copysign(1., zero["rows"][1]["square"]) == 1.
    exposed = _first(dict(DEFAULT_IV65, p1=-0.0, m=2, blend=0.0), "exposed")
    assert math.copysign(1., exposed["rows"][1]["effectiveP"]) == 1.
    tiny = _first(dict(DEFAULT_IV65, p1=5e-324), "tiny")["rows"][1]
    assert tiny["residual"] != 0. and tiny["square"] == 0. and tiny["squaredUnderflow"] == 1
    for row in zero["rows"]:
        assert "delta" not in row and "taint" not in row and "unavailable" in row
    try:
        zero["rows"][0]["square"] = 3.
    except TypeError:
        pass
    else:
        raise AssertionError("Saved evidence must be detached frozen data.")


def check_storage_and_capture():
    if not __debug__:
        raise RuntimeError("Explicit IV65 storage/publication check refuses optimized Python (-O).")
    original = _support._storage
    events = []

    class Storage:
        def __getitem__(self, index):
            if not __debug__:
                raise RuntimeError("Explicit IV65 storage hook refuses optimized Python (-O).")
            events.append(index)
            # Deliberately distinct ordinary words prove downstream storage consumption.
            return (1., 0., 0., 1., 1., 0.)[index[1]]

    def storage(values, rows, cols):
        if not __debug__:
            raise RuntimeError("Explicit IV65 storage factory refuses optimized Python (-O).")
        assert rows == 6 and cols == 1 and list(values) == [.75, .25, .75, .25, .5, .5]
        return Storage()

    try:
        _support._storage = storage
        result = _first(dict(DEFAULT_IV65), "storage")
        assert events == [(0, identifier, 0) for identifier in range(6)]
        assert result["cohorts"]["full"]["statistics"]["accuracy"] == 1.
        assert result["cohorts"]["full"]["statistics"]["brier"] == 0.
    finally:
        _support._storage = original
    events.clear()
    value = dict(DEFAULT_IV65)
    collector = reliability_trace()
    unknown = MemoryError("callback identity")

    class Observer:
        def add(self, identifier, label, equation, explanation, inputs, outputs):
            if not __debug__:
                raise RuntimeError("Explicit IV65 observer hook refuses optimized Python (-O).")
            assert events[:6] == [(0, identifier, 0) for identifier in range(6)]
            events.append(identifier)
            value['p0'] = 0.0
            collector.add(identifier, label, equation, explanation, inputs, outputs)

    try:
        _support._storage = storage
        result = evaluate_reliability(value, Observer(), "capture")
        assert result['state']['p0'] == .75 and value['p0'] == 0.
        assert result['summary']['fullAccuracy'] == 1. and result['summary']['fullBrier'] == 0.
        assert len(events) == 141 and events[6] == 'capture_raw'
    finally:
        _support._storage = original
    saved = _first(dict(DEFAULT_IV65), 'copy')
    original_finite = globals()['_finite']

    def forbidden(value):
        if not __debug__:
            raise RuntimeError("Explicit IV65 no-recompute hook refuses optimized Python (-O).")
        raise AssertionError("Projection must copy saved floats, not recompute them.")

    class FailingObserver:
        def add(self, identifier, label, equation, explanation, inputs, outputs):
            if not __debug__:
                raise RuntimeError("Explicit IV65 callback identity hook refuses optimized Python (-O).")
            raise unknown

    try:
        globals()['_finite'] = forbidden
        copied = _project(saved, reliability_trace(), 'copy')
        assert copied['summary']['fullBrier'] == saved['cohorts']['full']['statistics']['brier']
    finally:
        globals()['_finite'] = original_finite
    for unknown in (MemoryError('callback'), RuntimeError('programmer'), NumericalFault('UNKNOWN', 'observer')):
        try:
            evaluate_reliability(dict(DEFAULT_IV65), FailingObserver(), 'callback')
        except BaseException as error:
            assert error is unknown
        else:
            raise AssertionError('Trusted callback failures must escape unchanged.')
    for value, prefix in (({}, 'valid'), (dict(DEFAULT_IV65), 'bad-prefix')):
        trace = reliability_trace()
        try:
            evaluate_reliability(value, trace, prefix)
        except NumericalFault:
            assert trace.steps == [] and trace.outputs == {}
        else:
            raise AssertionError('Guards must precede every callback.')


def check_public():
    if not __debug__:
        raise RuntimeError("Explicit IV65 public check refuses optimized Python (-O).")
    trace = reliability_trace()
    result = evaluate_reliability(DEFAULT_IV65, trace, 'public')
    assert reliability_trace is _support.decoder_trace
    assert tuple(result) == ('state', 'summary', 'tensors', 'texts')
    assert len(trace.steps) == 135 and len(result['tensors']) == 46 and len(result['texts']) == 58
    assert sum(len(t['values']) for t in result['tensors']) == 283
    assert list(result['summary'])[:12] == ['fullCount', 'fullCorrect', 'fullTP', 'fullFN', 'fullFP', 'fullTN', 'fullPredictedPositive', 'fullActualPositive', 'fullSSE', 'fullMaxAbsoluteResidual', 'fullSquareUnderflowCount', 'fullContributionUnderflowCount']
    assert trace.steps[0]['id'] == 'public_raw'
    assert [step['id'] for step in trace.steps[1:5]] == ['public_copy_0', 'public_row_0', 'public_copy_1', 'public_row_1']
    by_id = {step['id']: step for step in trace.steps}
    assert by_id['public_full_fold_3']['inputs']['previousSSE'] == .6875
    assert by_id['public_full_fold_3']['outputs']['SSE'] == 1.25
    assert by_id['public_full_bin0_fold_3']['inputs']['previousN'] == 1
    assert by_id['public_full_bin0_fold_3']['outputs'] == dict(n=2, sumP=.5, sumY=1.)
    first_selection = by_id['public_full_loo_0_select']
    assert tuple(first_selection['inputs']) == ('omittedId', 'accuracy', 'brier')
    assert first_selection['outputs'] == dict(accuracyMin=2/5, accuracyMax=2/5, brierMin=27/80, brierMax=27/80, accuracyMinId=0, accuracyMaxId=0, brierMinId=0, brierMaxId=0)
    assert by_id['public_full_loo_1_select']['inputs']['accuracyMinId'] == 0
    assert by_id['public_full_loo_2_select']['outputs']['brierMinId'] == 2
    assert tuple(result['tensors'][0]) == ('id', 'shape', 'axes', 'dtype', 'values', 'provenance', 'precision')
    assert result['tensors'][2]['shape'] == [6, 7]
    assert result['tensors'][2]['values'][:7] == [.75, 1., .75, .5, -.25, .0625, .25]
    assert result['tensors'][3]['values'][:7] == [0, 1, 0, 1, 1, 0, 1]
    for tensor in result['tensors']:
        assert tensor['precision'] == (0 if tensor['dtype'] == 'int32' else 8)
        assert 1 <= len(tensor['shape']) <= 2 and max(tensor['shape']) <= 10
        assert len(tensor['values']) <= 42 and all(d > 0 for d in tensor['shape'])
    assert result['texts']['prompts'] == ['2+2', '2+3', '3+3', '3+4', '4+4', '4+5']
    assert result['texts']['candidates'] == ['4', '6', '7', '7', '8', '10']
    assert result['texts']['correctAnswers'] == ['4', '5', '6', '7', '8', '9']
    assert result['texts']['fullBin0MemberIds'] == ['1', '3']
    for step in trace.steps:
        assert tuple(step) == ('id', 'label', 'equation', 'explanation', 'inputs', 'outputs')
        for key, word in step['outputs'].items():
            actual = trace.outputs[step['id'] + '_' + key]
            assert actual == word and math.copysign(1., actual) == math.copysign(1., word)
    for m, frames in ((0, 135), (1, 121), (2, 109), (3, 99), (4, 91), (5, 84), (6, 82)):
        current_trace = reliability_trace()
        current = evaluate_reliability(dict(DEFAULT_IV65, m=m), current_trace, 'edge')
        assert len(current_trace.steps) == frames
        if m == 1:
            assert len(current['tensors']) == 47
        if m >= 5:
            assert 'cleanAccuracyMin' not in current['summary']
            assert not any(t['id'].startswith('edge_clean_Loo') for t in current['tensors'])
        if m == 5:
            assert current['summary']['cleanPrecision'] == 0. and 'cleanRecall' not in current['summary']
        if m == 6:
            assert current['texts']['cleanMemberIds'] == []
            assert 'cleanAccuracy' not in current['summary'] and 'cleanCalibrationGap' not in current['summary']
            assert 'n=0' in current['texts']['cleanBrierAvailability']
    high = evaluate_reliability(dict(DEFAULT_IV65, tau=1), reliability_trace(), 'high')
    assert 'fullPrecision' not in high['summary'] and high['summary']['fullRecall'] == 0.
    half = dict(DEFAULT_IV65, **{key: .5 for key in _FIELDS[:6]})
    half_result = evaluate_reliability(half, reliability_trace(), 'half')
    assert half_result['summary']['fullCalibrationGap'] == 0.
    assert not any(t['id'] == 'half_full_bin0_Metrics' for t in half_result['tensors'])
    zero_trace = reliability_trace()
    zero = evaluate_reliability(dict(DEFAULT_IV65, p1=-0., tau=-0., m=-0.), zero_trace, 'zero')
    zero_row = next(step for step in zero_trace.steps if step['id'] == 'zero_row_1')
    assert math.copysign(1., zero_row['inputs']['effectiveP']) == -1.
    assert math.copysign(1., zero_row['outputs']['residual']) == -1.
    assert math.copysign(1., zero_row['outputs']['square']) == 1.
    assert zero['tensors'][0]['values'][7] == 0 and type(zero['state']['m']) is int
    tiny = dict(DEFAULT_IV65, p0=1., p1=5e-324, p2=.5, p3=1., p4=1., p5=.5)
    tiny_trace = reliability_trace()
    tiny_result = evaluate_reliability(tiny, tiny_trace, 'tiny')
    lower = next(step for step in tiny_trace.steps if step['id'] == 'tiny_full_bin0_finish')
    assert lower['outputs']['absoluteGap'] == 5e-324 and lower['outputs']['contribution'] == 0.
    assert lower['outputs']['contributionUnderflow'] == 1
    assert tiny_result['summary']['fullSquareUnderflowCount'] == 1
    assert tiny_result['summary']['fullContributionUnderflowCount'] == 1
    try:
        result['tensors'][2]['values'][0] = 0.
    except TypeError:
        pass
    else:
        raise AssertionError('Public tensor words must be frozen detached copies.')


def check_trace():
    if not __debug__:
        raise RuntimeError("Explicit IV65 trace check refuses optimized Python (-O).")
    trace = reliability_trace()
    before, after = dict(x=-0.), dict(y=5e-324)
    trace.add('first', 'label', 'equation', 'explanation', before, after)
    before['x'], after['y'] = 1., 1.
    assert math.copysign(1., trace.steps[0]['inputs']['x']) == -1.
    assert trace.outputs['first_y'] == 5e-324
    for identifier, inputs, outputs, code in (
            ('first', {}, {}, 'INVALID_INPUT'), ('', {}, {}, 'INVALID_INPUT'),
            ('bad', dict(x=True), {}, 'NONFINITE'), ('bad', {}, dict(x=float('nan')), 'NONFINITE')):
        try:
            trace.add(identifier, 'l', 'e', 'x', inputs, outputs)
        except NumericalFault as error:
            assert type(error) is NumericalFault and error.code == code and len(trace.steps) == 1
        else:
            raise AssertionError('Trace admission must reject this boundary.')
    for identifier in range(1, 512):
        trace.add('frame' + str(identifier), 'l', 'e', 'x', {}, {})
    try:
        trace.add('overflow', 'l', 'e', 'x', {}, {})
    except NumericalFault as error:
        assert error.code == 'UNSUPPORTED_SIZE' and len(trace.steps) == 512
    else:
        raise AssertionError('The existing trace cap must remain active.')


def source_self_check():
    if not __debug__:
        raise RuntimeError("Explicit IV65 reference checks refuse optimized Python (-O).")
    check_mechanism()
    check_guards_and_words()
    check_storage_and_capture()
    check_public()
    check_trace()

3. Chapter entry and strict input boundary: iv65.py

Read the complete executable Python / NumPy source

This is the actual reference file, imported directly from the repository. Comments explain each operation. It is provided for later execution; no validation run is claimed.

"""IV65 canonical entry: independent scalar FIRST and adopted complete public binding.

SOURCE ONLY; all checks UNRUN. No --verify, implicit self-check or producer import.
"""
import importlib.util
import json
import math
from pathlib import Path
import sys
from types import FunctionType, ModuleType


_CACHE_NAMES = ("_book_iv65_evaluation", "_book_iv65_generic59")


def _load_reference():
    name = "_book_iv65_evaluation"
    path = str(Path(__file__).resolve().with_name("evaluation_reference.py"))
    if name in sys.modules:
        incumbent = sys.modules[name]
        if type(incumbent) is not ModuleType:
            raise ImportError("Unknown IV65 reference cache identity.")
        namespace = incumbent.__dict__
        certificate = namespace.get("_IV65_CERTIFICATE")
        if (type(certificate) is not tuple or len(certificate) != 6
                or certificate[0] is not incumbent or certificate[1] != path
                or type(namespace.get("__file__")) is not str
                or str(Path(namespace["__file__"]).resolve()) != path
                or namespace.get("__spec__") is not certificate[5]
                or certificate[5] is None or type(certificate[5].origin) is not str
                or str(Path(certificate[5].origin).resolve()) != path
                or namespace.get("__name__") != name or certificate[5].name != name):
            raise ImportError("Unknown or incomplete IV65 reference source identity.")
        for key, function, code in certificate[2]:
            if (namespace.get(key) is not function or type(function) is not FunctionType
                    or function.__code__ is not code or function.__globals__ is not namespace
                    or function.__module__ != name or str(Path(code.co_filename).resolve()) != path):
                raise ImportError("IV65 declaring function or code identity changed.")
        for cache_name, dependency in certificate[3]:
            if cache_name not in sys.modules or sys.modules[cache_name] is not dependency:
                raise ImportError("IV65 reference dependency cache identity changed.")
        for key, owned_object in certificate[4]:
            if namespace.get(key) is not owned_object:
                raise ImportError("IV65 reference alias changed.")
        incumbent._module_identity(namespace["_support"], str(Path(path).with_name("decoder_reference.py")))
        return incumbent
    snapshot = tuple((key, key in sys.modules, sys.modules.get(key)) for key in _CACHE_NAMES)
    spec = importlib.util.spec_from_file_location(name, path)
    for key, present, incumbent in snapshot:
        if (key in sys.modules) != present or (present and sys.modules[key] is not incumbent):
            raise ImportError("IV65 cache changed during specification creation.")
    if spec is None or spec.loader is None:
        raise ImportError("Cannot load adjacent IV65 independent reference.")
    staged = importlib.util.module_from_spec(spec)
    for key, present, incumbent in snapshot:
        if (key in sys.modules) != present or (present and sys.modules[key] is not incumbent):
            raise ImportError("IV65 cache changed during module creation.")
    transaction = [(name, staged)]
    staged._IV65_TRANSACTION = transaction
    sys.modules[name] = staged
    try:
        spec.loader.exec_module(staged)
        if name not in sys.modules or sys.modules[name] is not staged:
            raise ImportError("IV65 reference changed during loading.")
        functions = tuple((key, item, item.__code__) for key, item in staged.__dict__.items()
                          if type(item) is FunctionType and item.__module__ == name)
        aliases = tuple((key, staged.__dict__[key]) for key in
                        ("_support", "NumericalFault", "_freeze", "reliability_trace", "DEFAULT_IV65",
                         "_FIELDS", "_LABELS", "_CACHE_NAMES",
                         "math", "sys", "importlib", "Path", "FunctionType", "ModuleType"))
        dependencies = (("_book_iv65_generic59", staged._support), ("math", staged.math),
                        ("sys", staged.sys), ("importlib.util", staged.importlib.util))
        staged._IV65_CERTIFICATE = (staged, path, functions, dependencies, aliases, spec)
        staged._module_identity(staged, path)
        staged._module_identity(staged._support, str(Path(path).with_name("decoder_reference.py")))
        staged.__dict__.pop("_IV65_TRANSACTION", None)
        return staged
    except BaseException:
        for cache_name, owned_object in reversed(transaction):
            if cache_name in sys.modules and sys.modules[cache_name] is owned_object:
                del sys.modules[cache_name]
        raise


_reference = _load_reference()
NumericalFault = _reference.NumericalFault
DEFAULT_IV65 = _reference.DEFAULT_IV65
reliability_state = _reference.reliability_state
reliability_trace = _reference.reliability_trace
evaluate_reliability = _reference.evaluate_reliability
_KNOWN_CODES = ("INVALID_INPUT", "SHAPE_MISMATCH", "NONFINITE", "UNSUPPORTED_SIZE", "FULLY_MASKED_ROW", "UNAVAILABLE")


class _JsonInputError(ValueError):
    """Local strict-JSON admission failure only."""


def _integer(token):
    digits = token[1:] if token.startswith("-") else token
    if len(digits) > 309:
        raise _JsonInputError("JSON integer exceeds the local 309-digit limit.")
    return _real(token)


def _real(token):
    value = float(token)
    if not math.isfinite(value):
        raise _JsonInputError("JSON numbers must be finite binary64 values.")
    return value


def _constant(token):
    raise _JsonInputError("Non-JSON numeric constant: " + token)


def _object(pairs):
    result = {}
    for key, value in pairs:
        if key in result:
            raise _JsonInputError("Duplicate JSON object field: " + key)
        result[key] = value
    return result


_JSON_ERROR = json.JSONDecodeError
_JSON_PARSE_CODES = (json.JSONDecoder.decode.__code__, json.JSONDecoder.raw_decode.__code__)
_JSON_LOCAL_CODES = (_integer.__code__, _real.__code__, _constant.__code__, _object.__code__)
_JSON_DECODE = json.JSONDecoder(parse_int=_integer, parse_float=_real,
                                parse_constant=_constant, object_pairs_hook=_object).decode
_JSON_DECODE_ORIGINAL = _JSON_DECODE


def strict_json(text):
    try:
        return _JSON_DECODE(text)
    except (_JsonInputError, _JSON_ERROR) as error:
        if _JSON_DECODE is not _JSON_DECODE_ORIGINAL:
            raise
        origin = error.__traceback__
        while origin.tb_next is not None:
            origin = origin.tb_next
        if type(error) is _JsonInputError and origin.tb_frame.f_code in _JSON_LOCAL_CODES:
            raise NumericalFault("INVALID_INPUT", str(error)) from error
        if (type(error) is _JSON_ERROR and error.doc is text
                and origin.tb_frame.f_code in _JSON_PARSE_CODES):
            raise NumericalFault("INVALID_INPUT", "Expected one finite strict JSON value.") from error
        raise


def _fault_record(error):
    if (type(error) is not NumericalFault or type(getattr(error, "code", None)) is not str
            or error.code not in _KNOWN_CODES or type(getattr(error, "reason", None)) is not str):
        raise error
    return _reference._freeze(dict(status="unavailable", code=error.code, reason=error.reason))


def derive_iv65(value):
    """Capture before ANY callback; known faults only, full saved root5."""
    try:
        saved = _reference._first(value, "reliability")
        raw, trace = saved['state'], reliability_trace()
        trace.add('setup', 'Set up six disclosed rubric forecasts', 'raw=[p0,p1,p2,p3,p4,p5,tau,m,blend]; items=6; bins=2',
            'Capture the complete validated state before scoring. These are hand-set forecasts about fixed arithmetic candidates, not generated answers, measured model behavior or a random test sample.',
            dict(raw), dict(raw, itemCount=6, rawInputCount=9, binCount=2))
        evaluated = _reference._project(saved, trace, 'reliability')
        tensors, helper_summary = evaluated['tensors'], evaluated['summary']
        summary = {key: helper_summary[key] for key in ('fullAccuracy', 'fullBrier', 'cleanAccuracy', 'cleanBrier') if key in helper_summary}
        for key, word in helper_summary.items():
            if key not in summary:
                summary[key] = word
        summary['frames'], summary['tensorCount'] = len(trace.steps) + 1, len(tensors)
        trace.add('finish', 'Report the whole saved evaluation and its evidence limits', 'copy defined cohort summaries and descriptive deletion endpoints; omit unavailable metrics',
            'Copy the same complete saved result independently of the selected cursor. Missing clean evidence, empty bins and zero-denominator rates retain their saved reasons. Source frame/tensor counts are not hardware measurements or runtime acceptance.',
            dict(helper_summary), dict(summary))
        texts = dict(evaluated['texts'],
            summaryFields=list(summary),
            graphStages=['Validated raw forecasts', 'Disclosed exposure blend or word copy', 'Saved row decisions and squared errors', 'Full cohort fresh scoring', 'Clean cohort fresh scoring', 'Fixed two-bin calibration', 'Fresh deletion sensitivity'],
            graphTensorIds=[record['id'] for record in tensors],
            tracePolicy='reliabilityTrace is exactly the unchanged decoderTrace alias. Each actual frame captures finite operands and outputs once, snapshots detached plain data and enforces unique nonempty IDs and the512 cap. Root aliases frameId_key copy every saved frame output in frame/key order; they never recompute a metric. No StepRecord.state or invented unexecuted arithmetic is added.',
            rolePolicy='All float arithmetic operands/results/partials/copies, probability/tau/blend raw cells, labelOperand and bin boundaries are WORD. Raw/state/setup m and all item/bin/omission IDs, rubric labels, flags, counts, endpoint IDs, frames and tensorCount are VALUE. All int32 tensor cells are VALUE; Raw m alone is VALUE inside a float64 tensor. Every other float64 cell is WORD. Aliases inherit their source role; exact literal metadata and key order are binding.',
            validationPolicy='SOURCE IMPLEMENTATION ONLY. Every import, test, oracle, canonical parity, syntax/type/build, browser, accessibility and offline check is UNRUN under the human FluxGeo hold. Owner source adoption is separate from runtime validation and acceptance. No V3, native witness, timing or reliability certification is claimed.')
        outputs = dict(summary)
        for step in trace.steps:
            for key, word in step['outputs'].items():
                alias = step['id'] + '_' + key
                if alias in outputs:
                    raise RuntimeError('IV65 output aliases must be unique.')
                outputs[alias] = word
        return _reference._freeze(dict(status='defined', outputs=outputs, steps=trace.steps, tensors=tensors, texts=texts))
    except NumericalFault as error:
        return _fault_record(error)


def run():
    """Zero arguments; argv selects defaults, full replacement JSON, stdin/check."""
    args = sys.argv[1:]
    if args == ["--self-check"]:
        source_self_check()
        print("IV65 explicit source checks completed; owner validation remains separate.")
        return 0
    if len(args) > 1 or (args and args[0].startswith("--")):
        print("Usage: iv65.py [JSON|-|--self-check]", file=sys.stderr)
        return 2
    try:
        value = dict(DEFAULT_IV65) if not args else strict_json(sys.stdin.read() if args[0] == "-" else args[0])
        result = derive_iv65(value)
    except NumericalFault as error:
        result = _fault_record(error)
    print(json.dumps(result, allow_nan=False))
    return 0


def check_parser():
    if not __debug__:
        raise RuntimeError("Explicit IV65 parser check refuses optimized Python (-O).")
    assert math.copysign(1., strict_json("-0")) == -1.
    assert math.copysign(1., strict_json("-0.0")) == -1.
    assert strict_json("1" + "0" * 308) == 1e308
    for text in ("1" + "0" * 309, "9" * 309, "1e309", "NaN", "Infinity", "-Infinity",
                 '{"m":0,"m":1}', '{"p0":0,"p\\u0030":1}', "{} {}", "[1,]", "", "01"):
        try:
            strict_json(text)
        except NumericalFault as error:
            assert type(error) is NumericalFault and error.code == "INVALID_INPUT"
        else:
            raise AssertionError("Strict JSON must reject this text.")
    original = globals()["_JSON_DECODE"]
    try:
        original("{")
    except _JSON_ERROR as error:
        replayed_syntax = error
    else:
        raise AssertionError("The original decoder must reject incomplete JSON.")
    try:
        original("NaN")
    except _JsonInputError as error:
        replayed_local = error
    else:
        raise AssertionError("The original decoder must reject nonstandard constants.")
    unknowns = (ValueError("parser implementation"), MemoryError("parser resource"),
                _JsonInputError("foreign local error"), _JSON_ERROR("foreign JSON error", "x", 0),
                replayed_syntax, replayed_local)

    def foreign(text):
        if not __debug__:
            raise RuntimeError("Explicit IV65 parser-origin hook refuses optimized Python (-O).")
        raise unknown

    try:
        globals()["_JSON_DECODE"] = foreign
        for unknown in unknowns:
            try:
                strict_json("{}")
            except BaseException as error:
                assert error is unknown
            else:
                raise AssertionError("Unknown parser-origin objects must escape unchanged.")
    finally:
        globals()["_JSON_DECODE"] = original


def check_faults():
    if not __debug__:
        raise RuntimeError("Explicit IV65 fault check refuses optimized Python (-O).")
    for value in ({}, [], dict(DEFAULT_IV65, m=.5), dict(DEFAULT_IV65, p5=float("nan"))):
        record = derive_iv65(value)
        assert tuple(record) == ("status", "code", "reason") and record["status"] == "unavailable"
    for value in (DEFAULT_IV65, reliability_state(DEFAULT_IV65)):
        assert derive_iv65(value)['status'] == 'defined'
        assert evaluate_reliability(value, reliability_trace(), 'frozen')['summary']['fullAccuracy'] == .5
    original = _reference._project

    class Subtype(NumericalFault):
        pass

    def failing(saved, trace, prefix):
        if not __debug__:
            raise RuntimeError("Explicit IV65 producer-fault hook refuses optimized Python (-O).")
        raise unknown

    modeled = NumericalFault("INVALID_INPUT", "exact modeled fault")
    assert _fault_record(modeled) == dict(status="unavailable", code="INVALID_INPUT", reason="exact modeled fault")
    missing = NumericalFault("INVALID_INPUT", "missing reason")
    del missing.reason
    unknowns = (missing, NumericalFault(0, "invalid code type"), NumericalFault("UNKNOWN", "not modeled"), NumericalFault("INVALID_INPUT", 0),
                Subtype("INVALID_INPUT", "subtype"), RuntimeError("programming"), MemoryError("resource"))
    try:
        _reference._project = failing
        for unknown in unknowns:
            try:
                derive_iv65(dict(DEFAULT_IV65))
            except BaseException as error:
                assert error is unknown
            else:
                raise AssertionError("Unknown producer objects must escape unchanged.")
    finally:
        _reference._project = original


def check_cli():
    if not __debug__:
        raise RuntimeError("Explicit IV65 CLI check refuses optimized Python (-O).")
    from contextlib import redirect_stderr, redirect_stdout
    from io import StringIO
    original_argv, original_stdin = sys.argv, sys.stdin
    original_derive, original_checks = globals()["derive_iv65"], globals()["source_self_check"]
    received, checked = [], []

    def capture(value):
        if not __debug__:
            raise RuntimeError("Explicit IV65 CLI capture hook refuses optimized Python (-O).")
        received.append(value)
        return dict(status="unavailable", code="UNAVAILABLE", reason="Explicit CLI harness only.")

    def explicit():
        if not __debug__:
            raise RuntimeError("Explicit IV65 CLI self-check hook refuses optimized Python (-O).")
        checked.append(True)

    try:
        globals()["derive_iv65"], globals()["source_self_check"] = capture, explicit
        for args, stdin, expected in (([], "", dict(DEFAULT_IV65)), (["{}"], "", {}),
                                       (["-"], '{"p0":-0}', dict(p0=-0.0))):
            sys.argv, sys.stdin = ["iv65.py"] + args, StringIO(stdin)
            output, errors = StringIO(), StringIO()
            with redirect_stdout(output), redirect_stderr(errors):
                assert run() == 0
            assert received[-1] == expected and checked == [] and errors.getvalue() == ""
        assert math.copysign(1., received[-1]["p0"]) == -1.
        before = len(received)
        for args in (["--verify"], ["--self-check", "{}"], ["{}", "{}"], ["--unknown"]):
            sys.argv = ["iv65.py"] + args
            with redirect_stdout(StringIO()), redirect_stderr(StringIO()):
                assert run() == 2
            assert len(received) == before and checked == []
        for text in ("NaN", '{"m":0,"m":1}'):
            sys.argv = ["iv65.py", text]
            output = StringIO()
            with redirect_stdout(output):
                assert run() == 0
            assert strict_json(output.getvalue())["code"] == "INVALID_INPUT" and len(received) == before
        globals()["derive_iv65"] = original_derive
        sys.argv = ["iv65.py", "{}"]
        output = StringIO()
        with redirect_stdout(output):
            assert run() == 0
        assert strict_json(output.getvalue())["code"] == "INVALID_INPUT"
        sys.argv = ["iv65.py", "--self-check"]
        with redirect_stdout(StringIO()):
            assert run() == 0
        assert checked == [True]
        for args, stdin in (([], ""), ([json.dumps(dict(DEFAULT_IV65))], ""), (["-"], json.dumps(dict(DEFAULT_IV65)))):
            sys.argv, sys.stdin = ["iv65.py"] + args, StringIO(stdin)
            output = StringIO()
            with redirect_stdout(output):
                assert run() == 0
            published = strict_json(output.getvalue())
            assert published['status'] == 'defined' and published['outputs']['frames'] == 137
            assert published['outputs']['tensorCount'] == 46 and len(published['outputs']) == 715
        assert checked == [True]
    finally:
        sys.argv, sys.stdin = original_argv, original_stdin
        globals()["derive_iv65"], globals()["source_self_check"] = original_derive, original_checks


def check_loader():
    if not __debug__:
        raise RuntimeError("Explicit IV65 loader identity check refuses optimized Python (-O).")
    name, support_name = _CACHE_NAMES
    original, support = sys.modules[name], sys.modules[support_name]
    state, code = original.reliability_state, original.reliability_state.__code__
    saved_file, saved_spec, saved_fields = original.__file__, original.__spec__, original._FIELDS
    saved_storage = support._storage

    def foreign(value):
        if not __debug__:
            raise RuntimeError("Explicit IV65 foreign-source hook refuses optimized Python (-O).")
        raise AssertionError("Foreign source must not run.")

    try:
        assert _load_reference() is original and original._load_support() is support
        for target, loader, owned in ((name, _load_reference, original), (support_name, original._load_support, support)):
            for unknown in (None, object(), ModuleType(target)):
                sys.modules[target] = unknown
                try:
                    loader()
                except ImportError:
                    assert target in sys.modules and sys.modules[target] is unknown
                else:
                    raise AssertionError("Unknown incumbents, including None, must be preserved.")
                finally:
                    sys.modules[target] = owned
        for target in (name, support_name):
            saved = sys.modules.pop(target)
            try:
                if target == support_name:
                    try:
                        _load_reference()
                    except ImportError:
                        assert target not in sys.modules
                    else:
                        raise AssertionError("Deleted warm dependency must not silently reload.")
            finally:
                sys.modules[target] = saved
        original.reliability_state = foreign
        try:
            _load_reference()
        except ImportError:
            pass
        else:
            raise AssertionError("Declaring function replacement must be rejected.")
        original.reliability_state = state
        state.__code__ = foreign.__code__
        try:
            _load_reference()
        except ImportError:
            pass
        else:
            raise AssertionError("Declaring code replacement must be rejected.")
        state.__code__ = code
        for field, replacement in (("__file__", __file__), ("__spec__", None), ("_FIELDS", ())):
            saved = original.__dict__[field]
            original.__dict__[field] = replacement
            try:
                _load_reference()
            except ImportError:
                pass
            else:
                raise AssertionError("Source path, specification and field identity must be retained.")
            finally:
                original.__dict__[field] = saved
        support._storage = foreign
        try:
            _load_reference()
        except ImportError:
            pass
        else:
            raise AssertionError("Support declaring function must retain identity.")
    finally:
        original.reliability_state, state.__code__ = state, code
        original.__file__, original.__spec__, original._FIELDS = saved_file, saved_spec, saved_fields
        support._storage = saved_storage
        sys.modules[name], sys.modules[support_name] = original, support


def check_loader_staging():
    if not __debug__:
        raise RuntimeError("Explicit IV65 prestage check refuses optimized Python (-O).")
    name, support_name = _CACHE_NAMES
    original, support = sys.modules[name], sys.modules[support_name]
    saved_spec, saved_create = importlib.util.spec_from_file_location, importlib.util.module_from_spec

    def appearing_spec(cache_name, path):
        if not __debug__:
            raise RuntimeError("Explicit IV65 specification hook refuses optimized Python (-O).")
        result = saved_spec(cache_name, path)
        sys.modules[target] = None
        return result

    def appearing_create(spec):
        if not __debug__:
            raise RuntimeError("Explicit IV65 creation hook refuses optimized Python (-O).")
        result = saved_create(spec)
        sys.modules[target] = None
        return result

    try:
        for loaded, loader in ((name, _load_reference), (support_name, original._load_support)):
            for target in _CACHE_NAMES:
                for phase in ("spec", "create"):
                    sys.modules.pop(loaded, None)
                    if target != loaded:
                        sys.modules.pop(target, None)
                    importlib.util.spec_from_file_location = appearing_spec if phase == "spec" else saved_spec
                    importlib.util.module_from_spec = appearing_create if phase == "create" else saved_create
                    try:
                        loader()
                    except ImportError:
                        assert target in sys.modules and sys.modules[target] is None
                    else:
                        raise AssertionError("Both stages must preserve all newly appearing incumbents.")
                    finally:
                        importlib.util.spec_from_file_location, importlib.util.module_from_spec = saved_spec, saved_create
                        sys.modules[name], sys.modules[support_name] = original, support
    finally:
        importlib.util.spec_from_file_location, importlib.util.module_from_spec = saved_spec, saved_create
        sys.modules[name], sys.modules[support_name] = original, support


def check_loader_rollback():
    if not __debug__:
        raise RuntimeError("Explicit IV65 rollback check refuses optimized Python (-O).")
    name, support_name = _CACHE_NAMES
    original, support = sys.modules[name], sys.modules[support_name]
    saved_spec = importlib.util.spec_from_file_location
    replacement, unknown = object(), MemoryError("IV65 loader identity")

    class FailingLoader:
        def __init__(self, actual):
            if not __debug__:
                raise RuntimeError("Explicit IV65 loader wrapper refuses optimized Python (-O).")
            self.actual = actual

        def create_module(self, spec):
            if not __debug__:
                raise RuntimeError("Explicit IV65 loader creation hook refuses optimized Python (-O).")
            return self.actual.create_module(spec)

        def exec_module(self, module):
            if not __debug__:
                raise RuntimeError("Explicit IV65 loader execution hook refuses optimized Python (-O).")
            self.actual.exec_module(module)
            if mutation == "replace":
                sys.modules[target] = replacement
            elif mutation == "none":
                sys.modules[target] = None
            elif mutation == "delete":
                sys.modules.pop(target, None)
            raise unknown

    def failing_spec(cache_name, path):
        if not __debug__:
            raise RuntimeError("Explicit IV65 failing-spec hook refuses optimized Python (-O).")
        spec = saved_spec(cache_name, path)
        if cache_name == target:
            spec.loader = FailingLoader(spec.loader)
        return spec

    try:
        for target, loader in ((name, _load_reference), (support_name, original._load_support)):
            for mutation in ("keep", "replace", "none", "delete"):
                for preexisting in ((False, True) if target == name else (False,)):
                    sys.modules.pop(target, None)
                    if target == name:
                        sys.modules.pop(support_name, None)
                        if preexisting:
                            sys.modules[support_name] = support
                    importlib.util.spec_from_file_location = failing_spec
                    try:
                        loader()
                    except BaseException as error:
                        assert error is unknown
                    else:
                        raise AssertionError("Unknown BaseException must escape unchanged.")
                    finally:
                        importlib.util.spec_from_file_location = saved_spec
                    if mutation == "replace":
                        assert sys.modules[target] is replacement
                    elif mutation == "none":
                        assert target in sys.modules and sys.modules[target] is None
                    else:
                        assert target not in sys.modules
                    if target == name:
                        if preexisting:
                            assert sys.modules[support_name] is support
                        else:
                            assert support_name not in sys.modules
                    sys.modules[name], sys.modules[support_name] = original, support
        sys.modules.pop(name, None)
        sys.modules.pop(support_name, None)
        cold = _load_reference()
        assert cold is sys.modules[name] and cold is not original
        assert cold._support is sys.modules[support_name] and cold._support is not support
        assert cold._first(dict(cold.DEFAULT_IV65), "cold")["cohorts"]["full"]["statistics"]["SSE"] == 1.75
    finally:
        importlib.util.spec_from_file_location = saved_spec
        sys.modules[name], sys.modules[support_name] = original, support


def check_public_root():
    if not __debug__:
        raise RuntimeError("Explicit IV65 root check refuses optimized Python (-O).")
    result = derive_iv65(DEFAULT_IV65)
    assert tuple(result) == ('status', 'outputs', 'steps', 'tensors', 'texts')
    assert result['status'] == 'defined'
    assert (len(result['steps']), len(result['tensors']), len(result['outputs']), len(result['texts'])) == (137, 46, 715, 64)
    assert sum(len(tensor['values']) for tensor in result['tensors']) == 283
    outputs, steps = result['outputs'], result['steps']
    assert list(outputs)[:4] == ['fullAccuracy', 'fullBrier', 'cleanAccuracy', 'cleanBrier']
    assert (outputs['fullAccuracy'], outputs['fullBrier'], outputs['fullRecall']) == (.5, 7/24, 2/3)
    assert steps[0]['id'] == 'setup' and steps[-1]['id'] == 'finish'
    assert list(steps[0]['outputs'])[-3:] == ['itemCount', 'rawInputCount', 'binCount']
    assert list(steps[-1]['outputs']) == result['texts']['summaryFields']
    assert list(steps[-1]['inputs'])[:2] == ['fullCount', 'fullCorrect']
    expected_keys = list(result['texts']['summaryFields'])
    for step in steps:
        for key, word in step['outputs'].items():
            alias = step['id'] + '_' + key
            expected_keys.append(alias)
            assert outputs[alias] == word and math.copysign(1., outputs[alias]) == math.copysign(1., word)
    assert list(outputs) == expected_keys
    assert result['texts']['graphTensorIds'] == [tensor['id'] for tensor in result['tensors']]
    assert list(result['texts'])[-6:] == ['summaryFields', 'graphStages', 'graphTensorIds', 'tracePolicy', 'rolePolicy', 'validationPolicy']
    assert len(result['texts']['graphStages']) == 7
    for m, frame_count in ((0, 137), (1, 123), (2, 111), (3, 101), (4, 93), (5, 86), (6, 84)):
        edge = derive_iv65(dict(DEFAULT_IV65, m=m))
        assert len(edge['steps']) == edge['outputs']['frames'] == frame_count
        assert len(edge['tensors']) == edge['outputs']['tensorCount']
        assert len(edge['texts']) == 64
        if m == 6:
            assert 'cleanAccuracy' not in edge['outputs'] and 'finish_cleanBrier' not in edge['outputs']
            assert 'n=0' in edge['texts']['cleanBrierAvailability']
    changed = derive_iv65(dict(DEFAULT_IV65, m=4, blend=1))
    assert (changed['outputs']['fullAccuracy'], changed['outputs']['fullBrier']) == (5/6, 1/12)
    assert (changed['outputs']['cleanAccuracyMin'], changed['outputs']['cleanAccuracyMax']) == (0., 1.)
    zero = derive_iv65(dict(DEFAULT_IV65, p1=-0., tau=-0., m=-0.))
    for key in ('setup_p1', 'setup_tau', 'reliability_raw_p1', 'reliability_copy_1_effectiveP', 'reliability_row_1_residual'):
        assert math.copysign(1., zero['outputs'][key]) == -1.
    assert type(zero['outputs']['setup_m']) is int
    try:
        result['steps'][0]['inputs']['p0'] = 0.
    except TypeError:
        pass
    else:
        raise AssertionError('Root frames must be detached frozen records.')


def check_once_capture():
    if not __debug__:
        raise RuntimeError("Explicit IV65 once-capture check refuses optimized Python (-O).")
    original_first, original_factory = _reference._first, globals()['reliability_trace']
    first_calls, callbacks = [], []
    value = dict(DEFAULT_IV65)
    collector = reliability_trace()

    def first(raw, prefix):
        if not __debug__:
            raise RuntimeError("Explicit IV65 root capture hook refuses optimized Python (-O).")
        first_calls.append(raw)
        return original_first(raw, prefix)

    class Observer:
        def add(self, identifier, label, equation, explanation, inputs, outputs):
            if not __debug__:
                raise RuntimeError("Explicit IV65 root observer hook refuses optimized Python (-O).")
            assert first_calls == [value]
            callbacks.append(identifier)
            value['p0'] = 0.
            collector.add(identifier, label, equation, explanation, inputs, outputs)

        @property
        def steps(self):
            if not __debug__:
                raise RuntimeError("Explicit IV65 root steps hook refuses optimized Python (-O).")
            return collector.steps

    def factory():
        if not __debug__:
            raise RuntimeError("Explicit IV65 root factory hook refuses optimized Python (-O).")
        assert first_calls == [value]
        return Observer()

    try:
        _reference._first, globals()['reliability_trace'] = first, factory
        result = derive_iv65(value)
        assert len(first_calls) == 1 and len(callbacks) == 137
        assert callbacks[0] == 'setup' and callbacks[-1] == 'finish'
        assert result['outputs']['setup_p0'] == .75 and result['outputs']['fullAccuracy'] == .5
        assert value['p0'] == 0.
    finally:
        _reference._first, globals()['reliability_trace'] = original_first, original_factory


def source_self_check():
    if not __debug__:
        raise RuntimeError("Explicit IV65 source checks refuse optimized Python (-O).")
    _reference.source_self_check()
    check_parser()
    check_faults()
    check_public_root()
    check_once_capture()
    check_cli()
    check_loader()
    check_loader_staging()
    check_loader_rollback()


if __name__ == "__main__":
    raise SystemExit(run())

Connect the five questions to the evidence

The lab contains the sole five-question grader. The first asks what the authored forecast means; the second uses the fixed six-item defaults to distinguish SSE7/4 from mean Brier7/24; the third raises only the cutoff to1. The fourth quotes all current raw inputs, every saved row and both whole-cohort summaries/reasons. It distinguishes no clean items, one clean item and at least two clean items, independently of the selected operation. For a singleton, read the current rate denominators: default ID5 has defined precision0 and absent recall, but editing its forecast or cutoff can change which rates exist. The fifth combines the all-half zero-gap counterexample, descriptive deletion limits and rounded-zero underflow evidence. It adds no sixth question.

Use the current named tables for the live fourth question and the explicitly stated fixed inputs for the others. A clean count of two or more permits fresh deletion scores for this table; it does not establish a statistically adequate or representative sample. The worked worksheets explain the actual grader’s concepts without creating a second calculation or answer widget in this chapter.

Recap and bridge

  • State the prompt, candidate, rubric and cohort before reporting a score; our six labels and forecasts are completely disclosed and hand-set.
  • Accuracy evaluates threshold decisions; Brier evaluates probabilities; precision and recall use different positive-count denominators.
  • Two-bin calibration compares grouped forecasts and label frequencies. Zero coarse gap can coexist with wrong decisions.
  • Compare matched clean membership across contamination settings, and distinguish an unavailable metric from a defined zero.
  • Fresh deletion folds describe this table’s sensitivity; rounded-zero squares and finite sample scope remain visible limitations.

IV-66, From Text to Output: Full-Stack LLM Capstone, will connect text-to-output mechanisms in one teaching story. Such a trace will still need a declared evaluation rubric, data provenance and honest limits. This prose bridge does not create or enable a capstone application.