The neural notebook
← All chapters

IV-58 / Part XIV · Fine-Tuning and Alignment

Alignment, Safety and Evaluation Limits

Work through a fictional two-response rubric, expose disagreement and ranking changes, and separate a training objective, an evaluation proxy and observed behavior.

Review the ideas this chapter uses

Suppose two people read the same short answers. One values clear wording most; the other gives more credit for fitting the situation. A single average can choose a winner while hiding where their judgments differ. We will calculate that average, then look underneath it before deciding what the number can tell us.

Learning objective: Distinguish training objectives, evaluation proxies and observed behavior. Review IV-57 — Preference Data and Optimization Objectives for the preference objective and III-35 — Cross-Validation and Hyperparameter Tuning for Cross-Validation and Hyperparameter Tuning, especially the danger of choosing an evaluation rule after seeing its results.

Our fixed, author-written prompt is “Suggest a short break”. Response A is “Stretch your arms for a moment”; response B is “Look away from your screen for a moment”. These are exactly the authored texts used in IV-57. Here, two fictional annotators, numbered 0 and 1, assign invented ratings for clarity and context fit. No person was surveyed, no model generated these answers and no safety test was performed. The ratings are teaching inputs, not claims about which suggestion is better.

At the default, clarity gets weight 3/43/4 and context fit gets weight 1/41/4. A’s mean score is 11/8=1.37511/8=1.375; B’s is 9/8=1.1259/8=1.125. Yet annotator 0 ranks A higher and annotator 1 ranks B higher. That disagreement is the starting point of the lesson, rather than something the mean resolves.

Source checkpoint: The lab below uses the actual IV58 calculation; the two Python panels later display both complete canonical files. The worked examples are hand derivations. The hand derivations and source panels are distinct from import, numerical-check, rendering and interface-check results.

Compute it yourself

Alignment, Safety and Evaluation Limits

Inspect two authored short-break responses through two fictional annotators and two criteria. Edit eight integer ratings, the clarity weight w and the inclusive threshold tau to recompute the complete transparent rubric. This evaluates invented judgments without running or training a model.

Ratings must be integers 0, 1 or 2; w accepts any finite number in [0,1] and tau in [0,2]. All ten numeric fields admit -0 and keep its stored sign. Invalid, fractional-rating or unfinished drafts retain the last valid input state while withholding all computed evidence, explanations and graded questions. Fix the draft or reset to restore results. Reset restores the stated default; editing, resetting or selecting a trace step clears answers.

meanScoreA1.375
meanScoreB1.125
meanRank1
annotatorAgreementCategory1
Exact starting inputs for this saved calculation

meanScoreA 1.375. meanScoreB 1.125. meanRank 1. annotatorAgreementCategory 1. Set up two authored responses and a fictional rating matrix. The same short-break prompt and responses as IV57 receive invented clarity and context-fit ratings from two fictional annotators. Keep every raw numeric word, then evaluate the rubric without running or updating a model.

Set up two authored responses and a fictional rating matrix

raw=[scoreA00,scoreA01,scoreA10,scoreA11,scoreB00,scoreB01,scoreB10,scoreB11,w,tau]; responses=2; annotators=2; criteria=2

The same short-break prompt and responses as IV57 receive invented clarity and context-fit ratings from two fictional annotators. Keep every raw numeric word, then evaluate the rubric without running or updating a model.

Saved inputs

scoreA00
2
scoreA01
0
scoreA10
1
scoreA11
2
scoreB00
0
scoreB01
2
scoreB10
2
scoreB11
1
w
0.75
tau
1.25

Saved outputs

scoreA00
2
scoreA01
0
scoreA10
1
scoreA11
2
scoreB00
0
scoreB01
2
scoreB10
2
scoreB11
1
w
0.75
tau
1.25
responseCount
2
annotatorCount
2
criterionCount
2
rawInputCount
10

Authored text and fictional judgments

Prompt: Suggest a short break

The two unchanged authored responses
ResponseExact authored text
AStretch your arms for a moment
BLook away from your screen for a moment

The prompt and both responses are authored examples shared with IV57. Eight editable integer ratings belong to two fictional annotators and two invented criteria. They are not observed model outputs, human-study data, probabilities or validated safety labels.

Self-authored fixed prompt, two benign responses, fictional annotators, clarity/context-fit criteria and editable integer scores. The chapter evaluates a transparent rubric and its limits without running a model, measuring behavior, training or certifying safety. Runtime validation remains deferred under the FluxGeo hold.

A rubric is a stated scoring rule. A criterion is one thing rated: clarity or context fit here. The two fictional annotators supply separate judgments; neither is declared correct. Changing a rating, weight or threshold changes the proxy calculation while these response texts stay fixed.

Whole current root: all ten saved raw numeric words
Raw fieldSaved valueMeaning and admission
scoreA002Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
scoreA010Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
scoreA101Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
scoreA112Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
scoreB000Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
scoreB012Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
scoreB102Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
scoreB111Fictional integer rating 0, 1 or 2; -0 admitted without losing its word
w0.75Clarity weight w in [0,1], including -0
tau1.25Inclusive threshold tau in [0,2], including -0

Raw ratings use response A/B, annotator0/1, criterion clarity/contextFit row-major order. Products are [Response=2,Annotator=2,ProductField=2]; weighted scores [Response=2,Annotator=2]; response means [Response=2]; criterion tables [Response=2,Criterion=2]. Three comparisons are annotator0,annotator1,mean. Six threshold and score-sensitivity targets are A0,A1,B0,B1,meanA,meanB. No token, batch, model or parameter axis is implied.

Save the complement, then both products and their sum

Saved clarity weight w=0.75; saved context-fit weight c=1-w=0.25. A weighted score multiplies each rating by its weight, then adds the actual two products.

Actual ratings, two saved products and weighted scores
Response / annotatorClarity ratingContext-fit ratingw × claritySaved c × context fitSaved sum
A0201.501.5
A1120.750.51.25
B00200.50.5
B1211.50.251.75

Save complement=1-w once. For A0,A1,B0,B1, compute product0=w*score0, product1=complement*score1, then score=product0+product1, in that order. Both products execute at w zero or one. Reuse the actual complement and products; do not simplify a row or renormalize the weights.

Average each response’s two saved annotator scores

Response means: saved operands, sums, divisors and means
ResponseAnnotator 0 scoreAnnotator 1 scoreSaved sumSaved divisorSaved mean
A1.51.252.7521.375
B0.51.752.2521.125

For A then B, add the two saved annotator scores and divide by positive two. Next, for A clarity,A context fit,B clarity,B context fit, add the two raw annotator ratings and divide by positive two. These criterion means are unweighted views of the same matrix; no second weighting or hidden mean is applied.

Keep criterion disagreement visible beside aggregate disagreement

Each criterion: raw ratings, unweighted mean and signed/absolute disagreement
Response / criterionAnnotator 0 ratingAnnotator 1 ratingCriterion meanSigned difference 0−1Absolute difference
A · Clarity211.511
A · Context fit021-22
B · Clarity021-22
B · Context fit211.511
After aggregation: signed and absolute disagreement of saved weighted scores
ResponseAnnotator 0 scoreAnnotator 1 scoreSigned difference 0−1Absolute difference
A1.51.250.250.25
B0.51.75-1.251.25

For each response and criterion subtract raw annotator1 from raw annotator0, then take the absolute value. Separately subtract their saved weighted scores, then take that absolute value. Criterion differences can cancel during aggregation: a small aggregate disagreement need not mean agreement on clarity or context fit, and neither measure identifies a correct annotator.

In the fixed default, A’s raw criterion differences are +1 and -2, while its saved aggregate difference is +1/4. Weighting can make opposing differences cancel. These measures describe different views of the same judgments; a small aggregate difference does not establish agreement on each criterion.

Compare actual scores; keep rank, agreement and threshold separate

Three actual A/B comparisons and explicit rank codes
ComparisonSaved A operandSaved B operandSaved rank codeRank label
annotator01.50.51A
annotator11.251.75-1B
mean1.3751.1251A

The whole root saves mean A=1.375, mean B=1.125, meanRank=1. Separately, annotatorAgreementCategory=1 means “opposite strict orders”, using only the two annotator ranks.

Compare the actual stored A and B operands for annotator0,annotator1 and the response means: +1 means A higher,0 tie,-1 B higher. No epsilon or ideal-score gap replaces the comparison. Agreement category0 means both tie,1 opposite strict orders,2 one tie and one strict order,3 the same strict order. Only the two annotator ranks define that category; the mean rank remains separate.

All six saved inclusive threshold comparisons
TargetSaved score operandSaved tau operandSaved flag (0 or 1)Threshold label
A01.51.251pass
A11.251.251pass
B00.51.250fail
B11.751.251pass
meanA1.3751.251pass
meanB1.1251.250fail

The six flags compare actual A0,A1,B0,B1,meanA,meanB scores against tau with inclusive >=. Equality passes. They describe this chosen rubric threshold, not truth, calibrated confidence or safety. No pass counts or rates are computed, and ranks and thresholds have no claimed derivative.

The threshold is the chosen minimum rubric score. Its pass/fail label answers a different question from “which score is higher?” Both responses can pass, both can fail, or only one can pass. A tied pair can pass at equality. These statements concern this authored matrix and threshold.

Six formal score sensitivities with respect to w

A derivative describes the rate of change of a real-valued function. Hold all ratings fixed: a row’s real score is w×clarity+(1-w)×context fit, so its formal derivative is clarity−context fit. A response mean’s derivative averages its two row derivatives. The table reads the saved formal sensitivities.

Four row derivatives and two mean derivatives, in saved target order
Score targetSaved first operandSaved second operandOperation on these operandsSaved formal derivative
A020clarity − context fit2
A112clarity − context fit-1
B002clarity − context fit-2
B121clarity − context fit1
meanA2-1saved sum 1 divided by saved 20.5
meanB-21saved sum -1 divided by saved 2-0.5

Hold all eight rating words fixed. Four formal derivatives of the real affine scores with respect to w are score0-score1 in A0,A1,B0,B1 order. Add each response pair of saved derivatives and divide by positive two for meanA and meanB. These six sensitivities are not derivatives of binary64 rounding, integer rating choices, tau, ranks, pass flags or absolute-value kinks. No optimizer or model update is performed.

Why a smooth score does not give a derivative of a threshold decision

Fixed default ratings with tau=5/4 put A1 exactly on the threshold at w=3/4. With h=2^-10, its plus score is 1279/1024 and fails; its minus score is 1281/1024 and passes; the central score 1280/1024 passes at equality. This hand case illustrates a jumping Boolean downstream of an affine real score.

The prior score-only centered-difference claim is restricted to exactly all ten default raw words, w=3/4 and h=2^-10, for all six targets A0,A1,B0,B1,meanA,meanB together. Verify the whole actual central record first, then complete fresh v3Plus/v3Minus helper records, traces, tensors, nine unchanged raw words, actual endpoints and quotients before a zero verdict. Plus A1 fails tau while minus and central A1 pass, central at equality. This is a score sensitivity, never a decision gradient or a zero-budget claim for other states.

No finite-difference packet or authority verdict is produced by this view.

Rounding counterexamples, negative zero and input boundaries

For unchanged default ratings, let u=2^-55 and w=1/8+3u. The saved complement is7/8-4u, and actual A1 is15/8-8u, whereas simplifying to RN(2-w) gives15/8. At w=1/2-2^-54, the complement rounds to1/2: annotator0 ranks B, annotator1 ties and both means round to5/4. Real formulas alone therefore cannot determine binary64 ranks near a tie.

All ten raw numbers, state fields, operands and copies use WORD comparison, including score negative zero admitted by integer VALUE membership. Arithmetic keeps its actual signs: 1-(-0) gives positive one, multiplication and division can preserve negative zero, opposite-zero addition gives positive zero, and abs gives positive zero. Rank codes, flags, categories, counts and indices use VALUE. Display rounding or ordinary JSON conversion of -0 to0 cannot establish a word-preserving capture.

Provide exactly ten own data fields on an ordinary or null-prototype object. Check all descriptors, then all ten actual finite numbers, then all eight integer score domains [0,2], w in [0,1] and tau in [0,2], in raw order. No coercion, clipping, accessors, partial defaults or skipped zero-weight criteria. Every numeric raw copy retains its word, including score, w and tau negative zeros.

With admitted ratings0,1,2, the actual rounded complement lies in [0,1] and exact w+complement lies in [1-2^-54,1+2^-54], which rounds to1. Multiplication by2 is exact here, so monotonicity bounds every actual weighted score and mean in [0,2]. Criterion means lie in {0,0.5,1,1.5,2}, and disagreement magnitudes are at most2. These are bounds, not permission to replace literal operations or clamp an output.

Each stated arithmetic primitive is a separate finite binary64 round-to-nearest ties-to-even operation, with no contraction or reassociation. Save actual inputs and outputs once on both sides of each factory frame. Observers are trusted structurally, not branded. There are no exp, log, native elementary-function admission tolerances, hidden model calls or sampled observations. Display precision never feeds computation.

Saved source counts and limits of this evaluation proxy
Declared setup and finish counts from actual saved outputs
CounterSaved integer value
setup.responseCount2
setup.annotatorCount2
setup.criterionCount2
setup.rawInputCount10
finish.complementSubtractions1
finish.scoreMultiplications8
finish.scoreAdditions4
finish.responseMeanAdditions2
finish.responseMeanDivisions2
finish.criterionMeanAdditions4
finish.criterionMeanDivisions4
finish.rankDecisions3
finish.agreementClassifications1
finish.thresholdComparisons6
finish.criterionDifferenceSubtractions4
finish.criterionAbsoluteValues4
finish.aggregateDifferenceSubtractions2
finish.aggregateAbsoluteValues2
finish.weightGradientSubtractions4
finish.meanGradientAdditions2
finish.meanGradientDivisions2
finish.nativeElementaryCalls0
finish.modelRuns0
finish.optimizerSteps0
finish.frames35
finish.tensorCount13

Counts describe the declared scalar graph, three rank decisions, one agreement classification and six threshold comparisons. Frames include setup and finish, and tensorCount includes every pure-helper tensor. There is no total tensor-count cap, native call, model run or optimizer step. Snapshot and alias storage copies are not arithmetic work or hardware measurements. No pass count is hidden in the interface.

The IV57 training objective and this rubric proxy are different quantities: rubric ratings are neither log-probabilities nor losses. A lower objective does not imply higher rubric scores or safer behavior. Changing weights can reverse a ranking without changing response text; choosing weights or thresholds after viewing examples can overfit this proxy, as in III35. Two invented responses and annotators are no held-out population, empirical agreement study or alignment guarantee. Mathematical record consistency does not authenticate physical execution or rubric validity.

Complete saved operation text fallback: every frame in trace order

setup: Set up two authored responses and a fictional rating matrix

raw=[scoreA00,scoreA01,scoreA10,scoreA11,scoreB00,scoreB01,scoreB10,scoreB11,w,tau]; responses=2; annotators=2; criteria=2

The same short-break prompt and responses as IV57 receive invented clarity and context-fit ratings from two fictional annotators. Keep every raw numeric word, then evaluate the rubric without running or updating a model.

Saved inputs
scoreA00
2
scoreA01
0
scoreA10
1
scoreA11
2
scoreB00
0
scoreB01
2
scoreB10
2
scoreB11
1
w
0.75
tau
1.25
Saved outputs
scoreA00
2
scoreA01
0
scoreA10
1
scoreA11
2
scoreB00
0
scoreB01
2
scoreB10
2
scoreB11
1
w
0.75
tau
1.25
responseCount
2
annotatorCount
2
criterionCount
2
rawInputCount
10

rubric_complement: Save the context-fit weight once

complement=1-w

One actual rounded subtraction supplies every context-fit product. Do not reconstruct an ideal complement or simplify a later score.

Saved inputs
one
1
w
0.75
Saved outputs
complement
0.25

rubric_score_A0: Combine two criterion ratings for one annotator

product0=w*score0; product1=complement*score1; score=product0+product1

Compute both products, including at zero weights, then add their actual saved values. A rating is an invented rubric judgment, not a probability or observed model behavior.

Saved inputs
w
0.75
score0
2
complement
0.25
score1
0
Saved outputs
product0
1.5
product1
0
score
1.5

rubric_score_A1: Combine two criterion ratings for one annotator

product0=w*score0; product1=complement*score1; score=product0+product1

Compute both products, including at zero weights, then add their actual saved values. A rating is an invented rubric judgment, not a probability or observed model behavior.

Saved inputs
w
0.75
score0
1
complement
0.25
score1
2
Saved outputs
product0
0.75
product1
0.5
score
1.25

rubric_score_B0: Combine two criterion ratings for one annotator

product0=w*score0; product1=complement*score1; score=product0+product1

Compute both products, including at zero weights, then add their actual saved values. A rating is an invented rubric judgment, not a probability or observed model behavior.

Saved inputs
w
0.75
score0
0
complement
0.25
score1
2
Saved outputs
product0
0
product1
0.5
score
0.5

rubric_score_B1: Combine two criterion ratings for one annotator

product0=w*score0; product1=complement*score1; score=product0+product1

Compute both products, including at zero weights, then add their actual saved values. A rating is an invented rubric judgment, not a probability or observed model behavior.

Saved inputs
w
0.75
score0
2
complement
0.25
score1
1
Saved outputs
product0
1.5
product1
0.25
score
1.75

rubric_mean_A: Average the two saved annotator scores

sum=annotator0+annotator1; mean=sum/2

Each response mean divides its actual two-score sum by the literal positive two exactly once. A mean can conceal disagreement between annotators.

Saved inputs
annotator0
1.5
annotator1
1.25
two
2
Saved outputs
sum
2.75
mean
1.375

rubric_mean_B: Average the two saved annotator scores

sum=annotator0+annotator1; mean=sum/2

Each response mean divides its actual two-score sum by the literal positive two exactly once. A mean can conceal disagreement between annotators.

Saved inputs
annotator0
0.5
annotator1
1.75
two
2
Saved outputs
sum
2.25
mean
1.125

rubric_criterionMean_A0: Keep one criterion visible across annotators

sum=annotator0+annotator1; mean=sum/2

Average the two raw ratings for this response and criterion. Clarity is criterion zero and context fit is criterion one; no weight is applied again.

Saved inputs
annotator0
2
annotator1
1
two
2
Saved outputs
sum
3
mean
1.5

rubric_criterionMean_A1: Keep one criterion visible across annotators

sum=annotator0+annotator1; mean=sum/2

Average the two raw ratings for this response and criterion. Clarity is criterion zero and context fit is criterion one; no weight is applied again.

Saved inputs
annotator0
0
annotator1
2
two
2
Saved outputs
sum
2
mean
1

rubric_criterionMean_B0: Keep one criterion visible across annotators

sum=annotator0+annotator1; mean=sum/2

Average the two raw ratings for this response and criterion. Clarity is criterion zero and context fit is criterion one; no weight is applied again.

Saved inputs
annotator0
0
annotator1
2
two
2
Saved outputs
sum
2
mean
1

rubric_criterionMean_B1: Keep one criterion visible across annotators

sum=annotator0+annotator1; mean=sum/2

Average the two raw ratings for this response and criterion. Clarity is criterion zero and context fit is criterion one; no weight is applied again.

Saved inputs
annotator0
2
annotator1
1
two
2
Saved outputs
sum
3
mean
1.5

rubric_rank_0: Compare the actual saved A and B scores

rank=scoreA>scoreB?1:scoreA<scoreB?-1:0

Comparisons zero and one use their annotator scores; comparison two uses response means. A tie is explicit, with no epsilon, ideal-gap shortcut or tie-to-A rule.

Saved inputs
scoreA
1.5
scoreB
0.5
Saved outputs
rank
1

rubric_rank_1: Compare the actual saved A and B scores

rank=scoreA>scoreB?1:scoreA<scoreB?-1:0

Comparisons zero and one use their annotator scores; comparison two uses response means. A tie is explicit, with no epsilon, ideal-gap shortcut or tie-to-A rule.

Saved inputs
scoreA
1.25
scoreB
1.75
Saved outputs
rank
-1

rubric_rank_2: Compare the actual saved A and B scores

rank=scoreA>scoreB?1:scoreA<scoreB?-1:0

Comparisons zero and one use their annotator scores; comparison two uses response means. A tie is explicit, with no epsilon, ideal-gap shortcut or tie-to-A rule.

Saved inputs
scoreA
1.375
scoreB
1.125
Saved outputs
rank
1

rubric_agreement: Distinguish ties from strict ranking agreement or reversal

category=bothTie?0:oneTie?2:sameStrict?3:1

Category zero means both tie; one means opposite strict orders; two means one tie and one strict order; three means the same strict order. Only the two annotator ranks enter; the mean rank is separate.

Saved inputs
rank0
1
rank1
-1
Saved outputs
annotatorAgreementCategory
1

rubric_pass_A0: Apply the inclusive rubric threshold

pass=score>=tau?1:0

Equality passes. This flag describes the chosen threshold for an authored rating matrix; it is neither a safety label nor a probability, and it has no claimed derivative.

Saved inputs
score
1.5
tau
1.25
Saved outputs
pass
1

rubric_pass_A1: Apply the inclusive rubric threshold

pass=score>=tau?1:0

Equality passes. This flag describes the chosen threshold for an authored rating matrix; it is neither a safety label nor a probability, and it has no claimed derivative.

Saved inputs
score
1.25
tau
1.25
Saved outputs
pass
1

rubric_pass_B0: Apply the inclusive rubric threshold

pass=score>=tau?1:0

Equality passes. This flag describes the chosen threshold for an authored rating matrix; it is neither a safety label nor a probability, and it has no claimed derivative.

Saved inputs
score
0.5
tau
1.25
Saved outputs
pass
0

rubric_pass_B1: Apply the inclusive rubric threshold

pass=score>=tau?1:0

Equality passes. This flag describes the chosen threshold for an authored rating matrix; it is neither a safety label nor a probability, and it has no claimed derivative.

Saved inputs
score
1.75
tau
1.25
Saved outputs
pass
1

rubric_pass_meanA: Apply the inclusive rubric threshold

pass=score>=tau?1:0

Equality passes. This flag describes the chosen threshold for an authored rating matrix; it is neither a safety label nor a probability, and it has no claimed derivative.

Saved inputs
score
1.375
tau
1.25
Saved outputs
pass
1

rubric_pass_meanB: Apply the inclusive rubric threshold

pass=score>=tau?1:0

Equality passes. This flag describes the chosen threshold for an authored rating matrix; it is neither a safety label nor a probability, and it has no claimed derivative.

Saved inputs
score
1.125
tau
1.25
Saved outputs
pass
0

rubric_criterionDisagreement_A0: Measure disagreement before combining criteria

difference=annotator0-annotator1; disagreement=abs(difference)

Subtract the raw annotator ratings in annotator-zero minus annotator-one order, then take the absolute value. This retains criterion-level disagreement that weighted aggregation can conceal.

Saved inputs
annotator0
2
annotator1
1
Saved outputs
difference
1
disagreement
1

rubric_criterionDisagreement_A1: Measure disagreement before combining criteria

difference=annotator0-annotator1; disagreement=abs(difference)

Subtract the raw annotator ratings in annotator-zero minus annotator-one order, then take the absolute value. This retains criterion-level disagreement that weighted aggregation can conceal.

Saved inputs
annotator0
0
annotator1
2
Saved outputs
difference
-2
disagreement
2

rubric_criterionDisagreement_B0: Measure disagreement before combining criteria

difference=annotator0-annotator1; disagreement=abs(difference)

Subtract the raw annotator ratings in annotator-zero minus annotator-one order, then take the absolute value. This retains criterion-level disagreement that weighted aggregation can conceal.

Saved inputs
annotator0
0
annotator1
2
Saved outputs
difference
-2
disagreement
2

rubric_criterionDisagreement_B1: Measure disagreement before combining criteria

difference=annotator0-annotator1; disagreement=abs(difference)

Subtract the raw annotator ratings in annotator-zero minus annotator-one order, then take the absolute value. This retains criterion-level disagreement that weighted aggregation can conceal.

Saved inputs
annotator0
2
annotator1
1
Saved outputs
difference
1
disagreement
1

rubric_aggregateDisagreement_A: Measure disagreement after combining criteria

difference=annotator0-annotator1; disagreement=abs(difference)

Use the actual saved weighted scores. Opposing criterion differences can cancel, so a small aggregate disagreement does not establish criterion agreement or annotator correctness.

Saved inputs
annotator0
1.5
annotator1
1.25
Saved outputs
difference
0.25
disagreement
0.25

rubric_aggregateDisagreement_B: Measure disagreement after combining criteria

difference=annotator0-annotator1; disagreement=abs(difference)

Use the actual saved weighted scores. Opposing criterion differences can cancel, so a small aggregate disagreement does not establish criterion agreement or annotator correctness.

Saved inputs
annotator0
0.5
annotator1
1.75
Saved outputs
difference
-1.25
disagreement
1.25

rubric_weightGradient_A0: Differentiate the real weighted score with respect to w

gradient=score0-score1

Hold the integer ratings fixed. This is the formal derivative of the real affine score, not a derivative of the rounded complement, score labels, ranks or threshold decisions.

Saved inputs
score0
2
score1
0
Saved outputs
gradient
2

rubric_weightGradient_A1: Differentiate the real weighted score with respect to w

gradient=score0-score1

Hold the integer ratings fixed. This is the formal derivative of the real affine score, not a derivative of the rounded complement, score labels, ranks or threshold decisions.

Saved inputs
score0
1
score1
2
Saved outputs
gradient
-1

rubric_weightGradient_B0: Differentiate the real weighted score with respect to w

gradient=score0-score1

Hold the integer ratings fixed. This is the formal derivative of the real affine score, not a derivative of the rounded complement, score labels, ranks or threshold decisions.

Saved inputs
score0
0
score1
2
Saved outputs
gradient
-2

rubric_weightGradient_B1: Differentiate the real weighted score with respect to w

gradient=score0-score1

Hold the integer ratings fixed. This is the formal derivative of the real affine score, not a derivative of the rounded complement, score labels, ranks or threshold decisions.

Saved inputs
score0
2
score1
1
Saved outputs
gradient
1

rubric_weightGradient_meanA: Average the two formal score sensitivities

sum=annotator0+annotator1; gradient=sum/2

Use the actual two stored formal derivatives in response order, add, then divide by positive two. No optimizer, model update or gradient of a discrete assessment is involved.

Saved inputs
annotator0
2
annotator1
-1
two
2
Saved outputs
sum
1
gradient
0.5

rubric_weightGradient_meanB: Average the two formal score sensitivities

sum=annotator0+annotator1; gradient=sum/2

Use the actual two stored formal derivatives in response order, add, then divide by positive two. No optimizer, model update or gradient of a discrete assessment is involved.

Saved inputs
annotator0
-2
annotator1
1
two
2
Saved outputs
sum
-1
gradient
-0.5

finish: Report saved response means, mean rank and annotator ranking category

meanScoreA=means[0]; meanScoreB=means[1]; meanRank=ranks[2]; annotatorAgreementCategory=savedAgreementCategory

All four summaries copy the complete saved evaluation. A mean rank is separate from agreement between the two annotators. Source counts describe the declared calculation, not measurements of hardware, reliability, training or safety.

Saved inputs
meanA
1.375
meanB
1.125
rank
1
savedAgreementCategory
1
Saved outputs
meanScoreA
1.375
meanScoreB
1.125
meanRank
1
annotatorAgreementCategory
1
complementSubtractions
1
scoreMultiplications
8
scoreAdditions
4
responseMeanAdditions
2
responseMeanDivisions
2
criterionMeanAdditions
4
criterionMeanDivisions
4
rankDecisions
3
agreementClassifications
1
thresholdComparisons
6
criterionDifferenceSubtractions
4
criterionAbsoluteValues
4
aggregateDifferenceSubtractions
2
aggregateAbsoluteValues
2
weightGradientSubtractions
4
meanGradientAdditions
2
meanGradientDivisions
2
nativeElementaryCalls
0
modelRuns
0
optimizerSteps
0
frames
35
tensorCount
13

Every numeric table above reads this complete saved root. Numbers use round-trip decimal text, with negative zero shown as -0; display text never feeds computation. The inspector below exposes all scalar aliases, full text evidence and every tensor’s named axes, shape, dtype, precision, provenance and storage values. The selected trace step only highlights its saved operation.

Weights and thresholds can change a proxy conclusion without changing either response. Selecting them after viewing these examples can overfit the examples. Separate held-out evaluation and actual observations would be needed to study behavior beyond this authored pair.

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.

rubric_Raw

RawField=10 · float64 · precision 8 · Actual ten raw numeric words in scoreA00,scoreA01,scoreA10,scoreA11,scoreB00,scoreB01,scoreB10,scoreB11,w,tau order, including score negative zeros; integer admission does not normalize copies.

Zero-based storage indexStored value
02
10
21
32
40
52
62
71
80.75
91.25

rubric_Complement

ComplementField=1 · float64 · precision 8 · Actual once-computed binary64 context-fit weight 1-w, reused by all four context-fit products.

Zero-based storage indexStored value
00.25

rubric_Products

Response=2 × Annotator=2 × ProductField=2 · float64 · precision 8 · Actual product0=w*clarity then product1=complement*contextFit, in response A/B then annotator0/1 order; both products are evaluated even at zero weights.

Zero-based storage indexStored value
01.5
10
20.75
30.5
40
50.5
61.5
70.25

rubric_Scores

Response=2 × Annotator=2 · float64 · precision 8 · Actual saved sums product0+product1 in A0,A1,B0,B1 order; no algebraic score substitution.

Zero-based storage indexStored value
01.5
11.25
20.5
31.75

rubric_Means

Response=2 · float64 · precision 8 · Actual saved two-annotator score sums divided by positive two, response A then B.

Zero-based storage indexStored value
01.375
11.125

rubric_CriterionMeans

Response=2 × Criterion=2 · float64 · precision 8 · Actual raw-rating sums divided by positive two in A clarity,A context fit,B clarity,B context fit order; no second weighting.

Zero-based storage indexStored value
01.5
11
21
31.5

rubric_Ranks

Comparison=3 · int32 · precision 0 · Actual three-way rank codes for annotator0,annotator1,mean; +1 A,0 tie,-1 B, all integer VALUE roles.

Zero-based storage indexStored value
01
1-1
21

rubric_Passes

ThresholdTarget=6 · int32 · precision 0 · Actual inclusive threshold flags in A0,A1,B0,B1,meanA,meanB order; all integer VALUE roles.

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

rubric_CriterionDifference

Response=2 × Criterion=2 · float64 · precision 8 · Actual signed raw-rating differences annotator0-annotator1 in A clarity,A context fit,B clarity,B context fit order.

Zero-based storage indexStored value
01
1-2
2-2
31

rubric_CriterionDisagreement

Response=2 × Criterion=2 · float64 · precision 8 · Actual absolute values of the four saved criterion differences in response then criterion order; abs of either signed zero is positive zero.

Zero-based storage indexStored value
01
12
22
31

rubric_AggregateDifference

Response=2 · float64 · precision 8 · Actual signed weighted-score differences annotator0-annotator1, response A then B; criterion cancellation can reduce these differences.

Zero-based storage indexStored value
00.25
1-1.25

rubric_AggregateDisagreement

Response=2 · float64 · precision 8 · Actual absolute values of the two saved aggregate differences, response A then B; these do not replace criterion-level disagreement.

Zero-based storage indexStored value
00.25
11.25

rubric_WeightGradient

ScoreTarget=6 · float64 · precision 8 · Actual formal real w derivatives in A0,A1,B0,B1,meanA,meanB order; four raw criterion differences then two stored-gradient means, all floating WORD roles.

Zero-based storage indexStored value
02
1-1
2-2
31
40.5
5-0.5

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 authored prompt “Suggest a short break”, response A “Stretch your arms for a moment” and response B “Look away from your screen for a moment”, what distinguishes a training objective, this rubric proxy and observed behavior?
2. Fixed default: criterion order [clarity, context fit], ratings A0=[2,0], A1=[1,2], B0=[0,2], B1=[2,1], w=3/4 and tau=5/4. Raw ratings have axes [Response=2, Annotator=2, Criterion=2]. Which A1 products, A1 score and response A mean are correct?
3. Two fixed cases both use clarity/context-fit ratings A0=[2,0], A1=[1,2], B0=[0,2], B1=[2,1] and tau=5/4. Case R uses w=1/4; case T uses w=1/2. Which mean ranks and mean threshold flags follow?
4. Current whole saved root: scoreA00=2, scoreA01=0, scoreA10=1, scoreA11=2, scoreB00=0, scoreB01=2, scoreB10=2, scoreB11=1, w=0.75, tau=1.25. Mean A=1.375, mean B=1.125, meanRank=1. Annotator ranks=[1, -1]; annotatorAgreementCategory=1 (opposite strict orders). Saved flags [A0,A1,B0,B1,meanA,meanB]=[1, 1, 0, 1, 1, 0]. Which statement combines the current mean rank and mean threshold flags correctly? Read this complete root independently of the selected trace step.
5. Both fixed counterexamples use clarity/context-fit ratings A0=[2,0], A1=[1,2], B0=[0,2], B1=[2,1] and tau=5/4. C1 uses u=2^-55 and w=1/8+3u. C2 uses w=1/2-2^-54. Which rule remains valid for binary64 evaluation and the rubric’s limits?

Exactly five graded questions use fully stated fixed cases or the current whole saved root. Opening evidence leaves inputs and grades alone. Tables can be focused and scrolled with the keyboard; trace navigation, reset and every input use the existing house controls.

Read and edit one complete assessment

The first four summaries are meanScoreA, meanScoreB, meanRank and annotatorAgreementCategory. They describe the complete current calculation. The mean rank compares A with B; the agreement category compares the two annotators’ rankings. Selecting an earlier operation changes the saved step you inspect, while these summaries, evidence tables and the fourth question still refer to the whole current result.

There are exactly ten numeric fields, in the raw order used below. The first eight labels name response A or B, fictional annotator 0 or 1, and clarity or context fit: scoreA00, scoreA01, scoreA10, scoreA11, scoreB00, scoreB01, scoreB10, scoreB11. Each accepts an integer from 0 through 2. Clarity weight w (includes -0) accepts a finite number from 0 through 1; Inclusive rubric threshold τ (tau; includes -0) accepts a finite number from 0 through 2. Both allow arbitrary numerical steps. The prompt and response texts are fixed; there is no text editor or training control.

Start at the stated default and inspect A1’s two products, then A’s mean and the six threshold flags. Change only w from 0.75 to 0.25 to reverse the mean rank without changing either response. Next use w=0.5 to see both annotators tie A with B and both means pass at equality. The complete hand calculations below explain these cases. Restore the default before trying a change to tau alone, so you can distinguish a threshold change from a score change.

Reset example restores all ten defaults, the first trace step and unanswered questions. Draft text is separate from valid numerical state. A blank, nonfinite, out-of-range or fractional-rating draft such as scoreA10=1.5 shows an input error before replacing that state. The last valid state is retained internally, but summaries, saved inputs, trace, computed tables, inspector, questions and feedback are withheld until every draft is valid. Repair the draft or reset to restore results. Nothing is clipped, rounded to an integer or silently replaced with a default. The UI converts valid number text at its boundary; the numerical helper requires actual numbers.

Read the named tables in order: unchanged authored responses; all ten saved raw words; ratings, both products and scores; response-mean operands, sums and divisors; criterion means and signed/absolute disagreements; aggregate disagreements; three A/B comparisons; six inclusive thresholds; and six formal score sensitivities. The optional source-count table describes the declared graph, without measuring hardware or behavior. Every numeric table reads the same saved result. There is no computed pass count or agreement rate.

Use Previous step, Next step or Calculation step to inspect an operation’s equation, explanation, inputs and outputs. Open Complete saved operation text fallback: every frame in trace order to read all operations together; the cursor only highlights the selected one there. The separate inspector exposes all scalar aliases, full text evidence and every tensor’s values, named axes, shape, dtype, precision and provenance. Edits, reset and valid trace navigation clear answers; opening evidence preserves them. Numeric evidence explicitly shows negative zero as -0, and displayed decimals never feed back into computation. Tables have focusable scroll regions for keyboard reading. Narrow-screen layout, themes, reduced motion, keyboard and screen-reader behavior each need interaction evidence.

Three different kinds of evidence

A training objective is the numerical rule an optimization procedure tries to improve. A loss is an objective expressed as a penalty, so smaller is better under that rule. IV-57’s pairwise loss compares supplied policy and reference log-probabilities with a chosen preference label. A log-probability is the natural logarithm of a probability. Improving that loss means improving the declared comparison; it does not establish that the label captures every desirable property.

An evaluation proxy is a measurable substitute for a broader question. Our proxy is a small rubric: named criteria, a rating scale, weights and a threshold. An annotator supplies a judgment; a criterion names the aspect being judged. Here “clarity” and “context fit” are illustrative criterion names. The scale has just three permitted labels, 0, 1 and 2, with larger labels meaning more credit under this invented rubric. They are not probabilities. Averaging them assumes equal numerical steps between labels; that is a modeling choice, not a discovered fact about human judgments.

Observed behavior would be what a specified system actually does under specified conditions, with a record of how the observation was obtained. We have authored text and ratings, not a system run. Changing a rubric weight changes our numerical assessment of these fixed texts; it does not edit the texts or produce new behavior.

Alignment asks how system behavior relates to intended goals and constraints; safety asks about relevant harms and the conditions under which they may occur. Those questions need a stated context and evidence appropriate to it. Neither this clarity/context-fit rubric nor a lower IV-57 loss supplies a general answer. This chapter shares IV-57’s authored context, but does not call its numerical helper or reinterpret its log-probabilities as ratings.

Read the three axes before doing arithmetic

A tensor is an array whose axes tell us what each index means. Write a rating as rXajr_{Xaj}: XX names response A or B, aa names annotator 0 or 1, and jj names criterion 0 or 1. Criterion 0 is clarity; criterion 1 is context fit. We use jj for the criterion index because cc below will name the saved complementary weight.

The eight ratings can be understood as a conceptual cube of shape [Response=2, Annotator=2, Criterion=2]: two responses, each with two annotators, each with two criterion ratings. This gives 2×2×2=82\times2\times2=8 entries. In response-first order they are A0’s two criteria, A1’s two criteria, B0’s two criteria, then B1’s two criteria. A row below fixes one response and one annotator; its two columns run along the criterion axis. The actual record has no separate rating tensor: rubric_Raw stores all ten inputs in one array of shape [10], with axis RawField. Its first eight cells are these ratings, cell 8 is w and cell 9 is tau, using zero-based indices. Reading a conceptual cube must not invent an extra stored array.

ResponseAnnotatorClarity, criterion 0Context fit, criterion 1Raw fields in this row
A020scoreA00, scoreA01
A112scoreA10, scoreA11
B002scoreB00, scoreB01
B121scoreB10, scoreB11

In a field such as scoreA10, A names the response, 1 the annotator and 0 the criterion. Do not read it as “criterion 1, annotator 0.” Switching these axes changes which judgments are combined, even if a final average happens to look plausible.

The remaining inputs are ww, the clarity weight, and τ\tau (Greek tau), the threshold. Both are single numbers, called scalars, conceptually of shape []; their actual stored copies occupy the final two cells of rubric_Raw. The default is w=3/4=0.75w=3/4=0.75 and τ=5/4=1.25\tau=5/4=1.25. Valid ratings are actual finite integers from 0 through 2; ww lies from 0 through 1 and τ\tau from 0 through 2, including both endpoints. All numbers are dimensionless rubric points or weights; there is no token, batch or feature axis and no matrix multiplication.

The ten raw inputs, in order, are scoreA00, scoreA01, scoreA10, scoreA11, scoreB00, scoreB01, scoreB10, scoreB11, w, tau, with defaults 2, 0, 1, 2, 0, 2, 2, 1, 0.75, 1.25. Fractional ratings such as 1.5, missing ratings, strings, booleans and nonfinite values are invalid. A zero weight does not make an invalid rating acceptable. Inputs are not clipped into range, coerced or silently filled from defaults.

Two products, then one sum

Let c=1−wc=1-w be the context-fit weight. For one response and annotator, define pXap_{Xa} as the clarity product, qXaq_{Xa} as the context-fit product and SXaS_{Xa} as their sum:

c=1−w,pXa=w rXa0,qXa=c rXa1,SXa=pXa+qXa.c=1-w,\qquad p_{Xa}=w\,r_{Xa0},\qquad q_{Xa}=c\,r_{Xa1},\qquad S_{Xa}=p_{Xa}+q_{Xa}.

The subscripts XaXa say which row we are calculating. Multiplication is legal because each weight and rating is a scalar. Multiplying by 3/43/4 gives three quarters of that criterion’s credit. Adding the two products combines the two criteria for this one annotator. It does not average across annotators yet.

Save the complement once. Then calculate both products and the sum for A0, A1, B0 and B1, in that order. At the default every fraction and terminating decimal below is exact, including under the prescribed binary64 arithmetic; these are manual derivations, not measured program outputs.

RowClarity product ppContext-fit product qq, using c=1/4c=1/4Sum S=p+qS=p+q
A0(3/4)×2=3/2(3/4)\times2=3/2(1/4)×0=0(1/4)\times0=03/2+0=3/2=1.53/2+0=3/2=1.5
A1(3/4)×1=3/4(3/4)\times1=3/4(1/4)×2=1/2(1/4)\times2=1/23/4+1/2=5/4=1.253/4+1/2=5/4=1.25
B0(3/4)×0=0(3/4)\times0=0(1/4)×2=1/2(1/4)\times2=1/20+1/2=1/2=0.50+1/2=1/2=0.5
B1(3/4)×2=3/2(3/4)\times2=3/2(1/4)×1=1/4(1/4)\times1=1/43/2+1/4=7/4=1.753/2+1/4=7/4=1.75

Weighted scores are saved in rubric_Scores, shape [2,2], with axes [Response, Annotator]: response A then B, each with annotator 0 then 1. The criterion axis has been combined by the weighted sum. The eight products are saved separately in rubric_Products, shape [2,2,2], with axes [Response, Annotator, ProductField]. Its innermost pair is product0 (clarity product) then product1 (context-fit product). Although its dimensions match the conceptual rating cube, ProductField is not Criterion: these cells already contain weighted products. The saved complement itself is rubric_Complement, shape [1], axis ComplementField, holding one number rather than an extra rating.

Next give the two annotators equal influence. Let MAM_A and MBM_B be response means. Add A’s two scores and divide by 2; then do the same for B:

MA=SA0+SA12=3/2+5/42=6/4+5/42=11/42=118,M_A=\frac{S_{A0}+S_{A1}}2=\frac{3/2+5/4}2=\frac{6/4+5/4}2=\frac{11/4}2=\frac{11}8, MB=SB0+SB12=1/2+7/42=2/4+7/42=9/42=98.M_B=\frac{S_{B0}+S_{B1}}2=\frac{1/2+7/4}2=\frac{2/4+7/4}2=\frac{9/4}2=\frac98.

The two response means have shape [response=2] in A, B order. A sum of 11/411/4 is not A’s mean: the division by 2 matters. Nor do we divide a second time because there were two criteria; the weights already combined those criteria.

For a different view, average each criterion across annotators without applying weights. Write this as TXj=(rX0j+rX1j)/2T_{Xj}=(r_{X0j}+r_{X1j})/2. Then TA0=(2+1)/2=3/2T_{A0}=(2+1)/2=3/2, TA1=(0+2)/2=1T_{A1}=(0+2)/2=1, TB0=(0+2)/2=1T_{B0}=(0+2)/2=1 and TB1=(2+1)/2=3/2T_{B1}=(2+1)/2=3/2. These criterion means have shape [response=2, criterion=2]. A has the larger mean clarity rating; B has the larger mean context-fit rating. The chosen weight determines how much that difference matters to the combined score.

A rank and a threshold answer different questions

A rank compares A with B. Compare the actual two scores for annotator 0: 3/2>1/23/2>1/2, so that annotator ranks A higher. Annotator 1 compares 5/4<7/45/4<7/4 and ranks B higher. Comparing the response means gives 11/8>9/811/8>9/8, so the mean ranks A higher. A tie is an explicit third outcome, not permission to choose A.

The saved numeric codes use +1+1 for A higher, 00 for tie and −1-1 for B higher. rubric_Ranks has shape [3], axis Comparison, in annotator-0, annotator-1, mean order. Its default values are [+1,−1,+1][+1,-1,+1]. The mean’s public summary name is meanRank; it is a rubric ranking, not a preference probability.

Annotator agreement describes only the first two comparisons. Both may tie; they may have opposite strict orders; one may tie while the other has a strict order; or both may have the same strict order. Those four categories have codes 0, 1, 2 and 3 respectively. The default is opposite strict orders, code 1. The mean’s rank does not change the category, break a tie between annotators or establish which annotator is correct.

A threshold decision compares one score with a chosen cutoff. Here “passes” means only score greater than or equal to τ\tau, written S≥τS\ge\tau or M≥τM\ge\tau. Equality counts. With τ=5/4\tau=5/4, the decisions in A0, A1, B0, B1, mean-A, mean-B order are:

[pass,pass,fail,pass,pass,fail].[\text{pass},\text{pass},\text{fail},\text{pass},\text{pass},\text{fail}].

A1 passes at equality: 5/4≥5/45/4\ge5/4. B has one passing annotator score but a failing mean; we compared the mean score with the threshold rather than taking a majority vote over pass flags. If flags use 1 for pass and 0 for fail, this array is [1,1,0,1,1,0][1,1,0,1,1,0], shape [threshold target=6]. Counting its ones would count these six declared decisions, not independent trials or a safety probability.

Keep ratings and ww fixed and change only τ\tau. At τ=0\tau=0, both default means pass; at τ=2\tau=2, neither default mean passes. At τ=9/8\tau=9/8, both pass, including B at equality. At τ=11/8\tau=11/8, only A passes, at equality. The scores, ranks and response wording stay fixed. “Neither passes at 2” describes these default scores, not every allowed input: an edited mean of exactly 2 would pass the inclusive threshold 2.

Change the weights without changing either answer

Keep all eight default ratings and τ=5/4\tau=5/4, but set w=1/4w=1/4. Now c=3/4c=3/4. Compute the rows again:

SA0=(1/4)2+(3/4)0=1/2,SA1=(1/4)1+(3/4)2=1/4+3/2=7/4,S_{A0}=(1/4)2+(3/4)0=1/2,\qquad S_{A1}=(1/4)1+(3/4)2=1/4+3/2=7/4, SB0=(1/4)0+(3/4)2=3/2,SB1=(1/4)2+(3/4)1=1/2+3/4=5/4.S_{B0}=(1/4)0+(3/4)2=3/2,\qquad S_{B1}=(1/4)2+(3/4)1=1/2+3/4=5/4.

Thus MA=(1/2+7/4)/2=9/8M_A=(1/2+7/4)/2=9/8 and MB=(3/2+5/4)/2=11/8M_B=(3/2+5/4)/2=11/8. Annotator 0 now ranks B higher, annotator 1 ranks A higher and the mean ranks B higher. Only mean B passes the default threshold. The winner reversed because we changed the scoring rule, without changing a character of either response.

At w=1/2w=1/2, the complement is also 1/21/2. A0 gives 1+0=11+0=1 and B0 gives 0+1=10+1=1. A1 gives 1/2+1=3/21/2+1=3/2 and B1 gives 1+1/2=3/21+1/2=3/2. Both annotators tie A with B, and both response means are (1+3/2)/2=5/4(1+3/2)/2=5/4. Both means pass at equality. The category is both ties, code 0. This does not mean all four annotator scores are equal: comparisons pair A0 with B0 and A1 with B1.

Small aggregate disagreement can hide large criterion disagreement

An absolute difference, written with bars such as ∣2−1∣|2-1|, measures the size of a difference without its sign. Keep signed differences first so we can see what cancels. Define dXj=rX0j−rX1jd_{Xj}=r_{X0j}-r_{X1j} as annotator-0 minus annotator-1 rating on criterion jj, and DXj=∣dXj∣D_{Xj}=|d_{Xj}| as its magnitude.

For A, clarity gives 2−1=12-1=1 and context fit gives 0−2=−20-2=-2, so its criterion differences are [1,−2][1,-2] and magnitudes [1,2][1,2]. For B, the differences are [0−2,2−1]=[−2,1][0-2,2-1]=[-2,1] and magnitudes [2,1][2,1]. Each of these tables has shape [response=2, criterion=2]. An absolute difference of 2 is the full span of our rating scale.

Now define eX=SX0−SX1e_X=S_{X0}-S_{X1} as the difference between weighted scores, and QX=∣eX∣Q_X=|e_X| as aggregate disagreement. At the default:

eA=3/2−5/4=1/4,QA=1/4;eB=1/2−7/4=−5/4,QB=5/4.e_A=3/2-5/4=1/4,\quad Q_A=1/4;\qquad e_B=1/2-7/4=-5/4,\quad Q_B=5/4.

These arrays have shape [response=2]. For A, the weighted signed criterion differences contribute (3/4)×1=3/4(3/4)\times1=3/4 and (1/4)×(−2)=−1/2(1/4)\times(-2)=-1/2. Their sum is only 1/41/4. The positive clarity difference and negative context-fit difference partly cancel. Taking the absolute value afterward hides their opposing directions; it does not erase the underlying disagreements.

At w=1/4w=1/4, QA=∣1/2−7/4∣=5/4Q_A=|1/2-7/4|=5/4 and QB=∣3/2−5/4∣=1/4Q_B=|3/2-5/4|=1/4. At w=1/2w=1/2, both magnitudes are ∣1−3/2∣=1/2|1-3/2|=1/2. Identical aggregate disagreements therefore need not mean identical criterion ratings or agreement about each response. Report the criterion evidence alongside the aggregate rather than calling one small number annotator reliability.

A score can vary smoothly while a decision jumps

A derivative measures a real-valued function’s local rate of change. Here the relevant question is how a weighted score changes when we vary ww while keeping every rating fixed. Start in exact real arithmetic with c=1−wc=1-w. Expanding one score gives

SXa(w)=w rXa0+(1−w)rXa1=rXa1+w(rXa0−rXa1),dSXadw=rXa0−rXa1.S_{Xa}(w)=w\,r_{Xa0}+(1-w)r_{Xa1} =r_{Xa1}+w(r_{Xa0}-r_{Xa1}),\qquad \frac{dS_{Xa}}{dw}=r_{Xa0}-r_{Xa1}.

The notation dS/dwdS/dw means “rate of change of score SS with respect to weight ww.” Increasing clarity’s weight reduces context fit’s weight by the same amount. The coefficient is therefore the clarity rating minus the context-fit rating. It is not just the clarity rating. A score of the form constant plus coefficient times ww is called affine: its real graph is a straight line.

For the default ratings, the four derivatives in A0, A1, B0, B1 order are [2−0,1−2,0−2,2−1]=[2,−1,−2,1][2-0,1-2,0-2,2-1]=[2,-1,-2,1]. The mean derivatives are (2+(−1))/2=1/2(2+(-1))/2=1/2 for A and ((−2)+1)/2=−1/2((-2)+1)/2=-1/2 for B. Together the six score sensitivities are [2,−1,−2,1,1/2,−1/2][2,-1,-2,1,1/2,-1/2], shape [score target=6] in four-row-then-two-mean order. They describe six scores’ sensitivities to one weight, not a gradient of an invented scalar “alignment loss.” There is no optimizer or parameter update here.

For the fixed default ratings, the real score formulas simplify to SA0=2wS_{A0}=2w, SA1=2−wS_{A1}=2-w, SB0=2−2wS_{B0}=2-2w and SB1=1+wS_{B1}=1+w. Thus MA=1+w/2M_A=1+w/2 and MB=3/2−w/2M_B=3/2-w/2. In exact real arithmetic their difference is MA−MB=w−1/2M_A-M_B=w-1/2, which explains the earlier reversal. These formulas describe the real mathematical rule; they do not replace the literal floating-point operations discussed below.

A Boolean predicate is a yes-or-no condition. The predicate SA1≥τS_{A1}\ge\tau jumps when its score crosses the threshold. At the default, SA1=5/4=τS_{A1}=5/4=\tau passes. A small increase in ww lowers that real score and makes the predicate fail; a small decrease raises it and leaves the predicate passing. The real score has derivative −1-1 throughout. The pass flag does not have that derivative: its numeric encoding changes discontinuously from 1 to 0 at the boundary. Away from a boundary a Boolean flag is locally constant; at the jump its ordinary derivative is undefined. Neither fact makes a flag a useful smooth score gradient.

The adopted sensitivity concerns only these real weighted scores with ratings fixed. It is not a derivative with respect to the integer ratings, threshold, ranks, pass flags or agreement category. Absolute disagreement also has a corner where its signed difference reaches zero. We do not differentiate through those decisions or corners. Nor is a formal real derivative a derivative of the stepwise binary64 rounding map.

Optional: a complete hand sensitivity calculation at the default

Let h=2−10=1/1024h=2^{-10}=1/1024 be a small positive weight change. For any one of our six real score functions ff, the centered difference is (f(w+h)−f(w−h))/(2h)(f(w+h)-f(w-h))/(2h): subtract the lower-weight score from the higher-weight score, then divide by the total weight separation. The letters ff and hh name a score function and a step size, not new input controls.

Use exactly the default eight ratings and threshold, centered at w=3/4=768/1024w=3/4=768/1024. The lower weight is 767/1024767/1024 with complement 257/1024257/1024; the higher weight is 769/1024769/1024 with complement 255/1024255/1024. The denominator is 2h=1/5122h=1/512. The following values are hand-derived from both products and their sum, then the two mean divisions:

Score ffLower weight, w−hw-hHigher weight, w+hw+hHigher minus lowerDivide by 2h2h
SA0S_{A0}1534/10241534/10241538/10241538/10244/10244/102422
SA1S_{A1}1281/10241281/10241279/10241279/1024−2/1024-2/1024−1-1
SB0S_{B0}514/1024514/1024510/1024510/1024−4/1024-4/1024−2-2
SB1S_{B1}1791/10241791/10241793/10241793/10242/10242/102411
MAM_A2815/20482815/20482817/20482817/20482/20482/20481/21/2
MBM_B2305/20482305/20482303/20482303/2048−2/2048-2/2048−1/2-1/2

For example, at the higher weight A1 gives (769/1024)×1+(255/1024)×2=1279/1024(769/1024)\times1+(255/1024)\times2=1279/1024. B1 gives (769/1024)×2+(255/1024)×1=1793/1024(769/1024)\times2+(255/1024)\times1=1793/1024. A’s mean is then (1538/1024+1279/1024)/2=2817/2048(1538/1024+1279/1024)/2=2817/2048. The lower weight uses 767 and 257 in exactly the same operations. These small fractions with power-of-two denominators are exactly representable, as are every stated product, sum, difference and division in this particular calculation.

At threshold τ=1280/1024\tau=1280/1024, A1 passes at the lower weight (1281/10241281/1024), passes at the center (1280/10241280/1024), and fails at the higher weight (1279/10241279/1024). The two full assessments must therefore have different A1 pass flags even though the score difference gives exactly −1-1.

For an affine real score, this centered difference has no approximation error from curvature. These particular binary fractions also introduce no rounding error in the declared operations. That is a paper proof for this narrow default-centered case, not an executed check. A later zero-residual verification would still have to bind the actual complete central result and both complete endpoint results: all unchanged inputs, saved complements, products, means, comparisons, metadata and copied gradients. A hand table cannot serve as a manufactured runtime record. Other states retain their full rounded calculation and do not inherit a zero-error sensitivity claim.

Computer arithmetic keeps the operation order

Binary64 is a floating-point format with 53 bits of significant binary precision. Not every real number has a representable value. Write RN⁡(z)\operatorname{RN}(z) for rounding the real quantity zz to the nearest representable binary64 number; an exact midpoint chooses the value with an even final significand bit. This is called round to nearest, ties to even.

The declared calculation saves c=RN⁡(1−w)c=\operatorname{RN}(1-w) once. For each row it saves p=RN⁡(w rXa0)p=\operatorname{RN}(w\,r_{Xa0}), then q=RN⁡(c rXa1)q=\operatorname{RN}(c\,r_{Xa1}), then S=RN⁡(p+q)S=\operatorname{RN}(p+q). Each mean similarly rounds its sum before dividing by 2. Rounding one large combined expression or replacing A1’s calculation by RN⁡(2−w)\operatorname{RN}(2-w) can give a different answer. The simple fractions in our main examples happen to be exact; that does not justify simplifying every input’s operation sequence.

A numeric word means the stored bit pattern of a binary64 number. A displayed decimal is a presentation of that number; shortening it for display must not feed a rounded replacement back into a calculation or comparison. Rank the actual saved scores using greater than, equal to or less than. Do not invent an “almost equal” margin or let A win a tie.

Optional counterexample 1: one saved complement changes the last bit

Keep the eight default ratings. Define u=2−55u=2^{-55}, a small positive binary fraction, and choose w=1/8+3uw=1/8+3u. This is a representable input. The exact real complement is 7/8−3u7/8-3u, but neighboring representable values around that complement are 4u4u apart. Its nearest representable value is therefore c=7/8−4uc=7/8-4u, one uu below the exact real complement.

For A1, the clarity rating is 1 and the context-fit rating is 2. Its first product is exactly ww; its second is exactly 2c=7/4−8u2c=7/4-8u. Adding those saved products gives the exact pre-rounding quantity 15/8−5u15/8-5u. Representable values around this sum are 8u8u apart, so its stored weighted score is

SA1=RN⁡(15/8−5u)=15/8−8u.S_{A1}=\operatorname{RN}(15/8-5u)=15/8-8u.

The algebraically simplified alternative would instead give

RN⁡(2−w)=RN⁡(15/8−3u)=15/8.\operatorname{RN}(2-w)=\operatorname{RN}(15/8-3u)=15/8.

The first quantity is closer to the lower neighbor; the second is closer to the upper neighbor. The results differ by one representable step, despite identical real-algebra intentions. Preserve the saved complement and both products. This manual counterexample concerns the numerical graph, not an observed model behavior or a reported program run.

Optional counterexample 2: a nearby weight produces one strict order and one tie

Keep the default ratings and threshold and choose w=1/2−2−54w=1/2-2^{-54}, the representable value immediately below 1/21/2. The exact real complement is 1/2+2−541/2+2^{-54}, halfway between two representable values above and at 1/21/2. Ties-to-even chooses the saved complement c=1/2c=1/2.

Annotator 0’s actual scores are SA0=2w=1−2−53S_{A0}=2w=1-2^{-53} and SB0=2c=1S_{B0}=2c=1. Thus B is strictly higher. For annotator 1, the saved products give

SA1=RN⁡(w+2c)=RN⁡(3/2−2−54)=3/2,S_{A1}=\operatorname{RN}(w+2c)=\operatorname{RN}(3/2-2^{-54})=3/2,SB1=RN⁡(2w+c)=RN⁡(3/2−2−53)=3/2.S_{B1}=\operatorname{RN}(2w+c)=\operatorname{RN}(3/2-2^{-53})=3/2.

The first is nearest to 3/23/2; the second is a midpoint whose even neighbor is 3/23/2. Annotator 1 ties. A’s pre-rounding score sum is 5/2−2−535/2-2^{-53}, which rounds to 5/25/2; B’s sum is exactly 5/25/2. Dividing each saved sum by 2 makes both means 5/45/4. The ranks are therefore [−1,0,0][-1,0,0]: B higher for annotator 0, tie for annotator 1, tie for the means. The annotator-agreement category is one tie and one strict order, code 2. Both means pass the default threshold at equality.

In exact real arithmetic, the default-rating formulas predict opposite strict orders whenever w≠1/2w\ne1/2. This representable input shows why that theorem cannot be used as the rank rule for the rounded graph. It is not enough to inspect ww or an ideal algebraic gap; compare the stored score operands. The stored means also illustrate that a tiny nonzero mathematical difference need not survive rounding.

At the endpoints w=0w=0 and w=1w=1, both criterion ratings still require validation and both products still belong to the calculation. For the default ratings, w=0w=0 gives scores [0,2,2,1][0,2,2,1] and means [1,3/2][1,3/2]; w=1w=1 gives scores [2,1,0,2][2,1,0,2] and means [3/2,1][3/2,1]. These endpoint hand cases do not train anything or excuse an out-of-range rating attached to a zero weight.

Binary64 has both positive and negative zero. An input score, ww or τ\tau equal to negative zero satisfies the numeric domain in the same way as zero, but an exact raw copy must retain its word. Arithmetic can change a zero’s sign: 1−(−0)1-(-0) is positive 1, while the absolute value of negative zero is positive zero. Numeric comparisons treat the two zeros as equal. Preserve input and operand words where a copy is promised rather than normalizing all zeros; rank codes and pass flags describe discrete values instead.

The adopted raw boundary requires a complete ordinary or null-prototype data record with exactly the ten fields. A data field stores a value directly; an accessor instead runs code to obtain it. All own-field descriptors are inspected before any value is read, and all ten values must be actual finite numbers before any integer or range test. For example, an out-of-range rating together with nonfinite τ\tau fails the finite-number stage first. A bad input has no successful assessment to interpret. These are declared source semantics, not guard or interface check results.

The limits belong beside the result

Our arithmetic answers a precise question: what this stated rubric says about these stated ratings of these two authored responses. It does not tell us whether the criteria cover the relevant goals, whether the 0–2 scale is appropriate, whether annotators would reproduce the ratings or whether the weights reflect a real use case. A small aggregate disagreement is especially weak evidence when signed criterion differences cancel.

Selecting ww after seeing which answer wins can make the metric favor that answer. Selecting τ\tau after seeing the scores can make a desired answer pass. This is the evaluation-selection problem from III-35 — Cross-Validation and Hyperparameter Tuning: repeated choices guided by evaluation results can fit the evaluation examples. In a real study, separate data used to select a rule from held-out data reserved to assess it, and document the choice process. A held-out result would still apply to its sampled tasks and conditions. Our two invented responses and two invented annotators supply neither such a split nor a representative population.

There is no measured agreement rate, calibrated confidence, empirical annotator reliability or general safety rate in this example. A threshold pass means only the declared inequality held. A mathematically consistent record means its operations and copies agree with its declared numerical graph; it does not authenticate a physical execution, validate the rubric or establish safer behavior. Lowering IV-57’s preference loss likewise has no mathematical implication that any of these rubric scores rises or that either response passes this threshold.

Keep three questions separate when interpreting any larger evaluation: What rule was optimized? What proxy was reported? What behavior was actually observed, and under which conditions? Keeping the answers separate makes the numbers more useful, because their scope remains visible.

Use the five questions to explain your reasoning

The lab contains the chapter’s single set of five graded questions. Each answer opens corrective reasoning for the alternatives. The fixed-case questions state their own ratings, weights and thresholds; they do not silently use your current edits.

  1. Objective, proxy and behavior: explain what kind of evidence each name requires. Ask whether any model or human observation actually occurred before interpreting a fictional rating as behavior.
  2. Axes, products and a mean: follow A1’s clarity/context-fit pair in the fully stated default. Calculate its two products, then combine A0 and A1 and divide their sum by 2. Keep the annotator index separate from the criterion index.
  3. Reversal and inclusive ties: compare the fully stated cases R (w=1/4) and T (w=1/2). Work out both means and both threshold decisions. A tied pair can pass at equality; changing the scoring rule does not change the response text.
  4. Your whole current result: read the question’s saved ten inputs, both means, meanRank, annotator category and six flags. Combine the actual mean rank with the two saved mean flags, even when you have selected an early trace step. Revisit this question after a valid edit; do not assume the default or calculate a rank from an ideal algebraic gap. The annotator category answers a separate question.
  5. Rounded graph and limits: use both fully stated counterexamples C1 and C2. Explain why the saved complement matters in C1 and why C2 contains a strict order alongside a tie. Then separate mathematical consistency of this rubric from evidence about observed behavior or safety.

Read the complete Python calculation

The next two disclosures contain the entire actual canonical files, in dependency order: rubric_reference.py, then iv58.py. They are imported directly as raw source text, including all branches and explicit checks. Keep both files adjacent for later use. This calculation’s project-source dependency closure consists of exactly these two files; Python’s standard library and NumPy are external dependencies. Displaying the source does not install, import or execute the Python files.

1. rubric_reference.py: guard, calculate, save, then describe

Start with rubric_state(value). It requires an exact Python dictionary containing all ten fields. It rejects nonnumbers and nonfinite floats before checking any rating or range. It checks domains before converting to Python floats, so even an enormous integer fails its domain without an unsafe conversion. Booleans are rejected. All ten admitted values become floats, including integer-valued ratings: accepting -0.0 as rating zero must not erase its stored sign. Python dictionaries do not have JavaScript property descriptors or getters; this carrier enforces its own exact-dictionary boundary.

Read _evaluate_rubric_mechanics next. w and tau are the same controls as in the lab. save checks and records each scalar result. complement is computed once; each row saves its clarity product, context-fit product and sum, then each response saves a sum and a division by 2. criterion_means averages raw judgments without weighting them again. ranks compares stored operands; passes uses inclusive thresholds. The difference arrays retain signed differences beside their absolute magnitudes. weight_gradient holds the four formal real score derivatives followed by their two means. These are Python-float operations in the declared order, rather than vectorized substitutes.

NumPy supplies storage, not the arithmetic graph. _storage copies those saved numbers into row-major arrays and reshapes them to the stated dimensions. evaluate_rubric(value, trace, prefix) assembles the public frames and tensors from the captured values. It does not recalculate scores to make a display agree. The returned helper includes state, complement, products, scores, means, criterion views, ranks, passes, both disagreement views, sensitivities and tensors as detached copies. Changing one returned list must not change an earlier saved trace or a separate copy.

The float tensors use float64 with display precision 8; rubric_Ranks and rubric_Passes use int32 with precision 0. Display precision describes presentation, not rounding of stored values. The inspector’s exact-value text retains the stored numbers, including negative zero.

Optional: map every saved tensor to its axes

Each row names an actual tensor, not an additional conceptual array. Response runs A then B; Annotator runs 0 then 1; Criterion runs clarity then context fit. All storage is row-major, so the final axis changes fastest.

TensorShapeOrdered axes and contents
rubric_Raw[10]RawField: eight rating words, w, tau
rubric_Complement[1]ComplementField: saved 1-w
rubric_Products[2,2,2]Response, Annotator, ProductField: product0, product1
rubric_Scores[2,2]Response, Annotator: A0, A1, B0, B1
rubric_Means[2]Response: A, B
rubric_CriterionMeans[2,2]Response, Criterion: unweighted means
rubric_Ranks[3]Comparison: annotator0, annotator1, mean
rubric_Passes[6]ThresholdTarget: A0, A1, B0, B1, meanA, meanB
rubric_CriterionDifference[2,2]Response, Criterion: signed annotator0 minus annotator1
rubric_CriterionDisagreement[2,2]Response, Criterion: absolute saved differences
rubric_AggregateDifference[2]Response: signed weighted-score differences
rubric_AggregateDisagreement[2]Response: absolute saved differences
rubric_WeightGradient[6]ScoreTarget: A0, A1, B0, B1, meanA, meanB

The conceptual rating cube has no separate tensor in this table. All ten raw cells, including integer-valued ratings, carry binary64 words. The rank and pass tensors carry discrete values. Exact copy verification must preserve those roles: ordinary JavaScript JSON conversion can turn -0 into 0, which loses a promised input word even though numeric comparisons consider them equal.

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.

"""IV58 canonical scalar mechanisms and adopted public binding; checks UNRUN.

No project imports. Python floats evaluate the literal graph; NumPy only stores
copies. Independent FIRST operands/results supply the complete public record.
"""
from copy import deepcopy
import math
import re
import struct
from types import MappingProxyType

import numpy as np

RAW_KEYS = ("scoreA00", "scoreA01", "scoreA10", "scoreA11",
            "scoreB00", "scoreB01", "scoreB10", "scoreB11", "w", "tau")
DEFAULT_IV58 = MappingProxyType(dict(zip(RAW_KEYS,
    (2.0, 0.0, 1.0, 2.0, 0.0, 2.0, 2.0, 1.0, 0.75, 1.25))))


class NumericalFault(ValueError):
    """Known semantic input fault; unknown exceptions retain their identity."""

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


def _number(value, label):
    # All finite integer magnitudes reach domain admission before float conversion.
    if type(value) not in (int, float) or (type(value) is float and not math.isfinite(value)):
        raise NumericalFault("NONFINITE", f"{label} must be an actual finite number.")
    return value


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


def rubric_state(value):
    """Snapshot an exact dict, check ALL finite inputs, THEN domains, THEN floats.

    Python's exact dict carrier has no property descriptors/getters. Subclasses,
    mappings and custom keys are rejected before field access. No partial merge.
    """
    if type(value) is not dict:
        raise NumericalFault("INVALID_INPUT", "state must be a plain object.")
    if len(value) != 10 or any(type(key) is not str for key in value) or set(value) != set(RAW_KEYS):
        raise NumericalFault("INVALID_INPUT", "state must have exactly scoreA00, scoreA01, scoreA10, scoreA11, scoreB00, scoreB01, scoreB10, scoreB11, w, tau as own fields.")
    saved = {key: value[key] for key in RAW_KEYS}
    for key in RAW_KEYS:
        _number(saved[key], key)
    for key in RAW_KEYS[:8]:
        if saved[key] not in (0, 1, 2):
            raise NumericalFault("INVALID_INPUT", f"{key} must be an integer between 0 and 2.")
    if not 0 <= saved["w"] <= 1:
        raise NumericalFault("INVALID_INPUT", "w must be between 0 and 1.")
    if not 0 <= saved["tau"] <= 2:
        raise NumericalFault("INVALID_INPUT", "tau must be between 0 and 2.")
    # Score admission is VALUE; every raw/operand/storage copy remains WORD.
    return {key: float(saved[key]) for key in RAW_KEYS}


def _numeric_record(value, label):
    if type(value) is not dict or any(type(key) is not str for key in value):
        raise NumericalFault("INVALID_INPUT", f"{label} must be a plain numeric record.")
    saved = value.copy()
    for key, number in saved.items():
        _number(number, f"{label}.{key}")
    for key, number in saved.items():
        if not -float.fromhex("0x1.fffffffffffffp+1023") <= number <= float.fromhex("0x1.fffffffffffffp+1023"):
            raise NumericalFault("NONFINITE", f"{label}.{key} must be an actual finite number.")
    return saved


class _OperandTrace:
    """Independent FIRST operand frames, not the adopted six-field public steps."""

    def __init__(self):
        self.steps = []
        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.")
        captured_inputs = _numeric_record(inputs, f"{identifier}.inputs")
        captured_outputs = _numeric_record(outputs, f"{identifier}.outputs")
        if len(self.steps) >= 512:
            raise NumericalFault("UNSUPPORTED_SIZE", "At most 512 operations are supported.")
        self.steps.append(deepcopy(dict(id=identifier, inputs=captured_inputs,
                                        outputs=captured_outputs)))
        self._ids.add(identifier)


def _operand_trace():
    return _OperandTrace()


def _evaluate_rubric_mechanics(value, trace, prefix):
    """Independent scalar graph; a trusted structural observer receives evidence.

    Every primitive is performed once, then checked and saved before observation.
    Prefix admission follows the complete raw guard sequence. No issuer brand.
    """
    state = rubric_state(value)
    if type(prefix) is not str or re.fullmatch(r"[A-Za-z][A-Za-z0-9_]*", prefix, flags=re.ASCII) is None:
        raise NumericalFault("INVALID_INPUT", "prefix must start with an ASCII letter and contain only ASCII letters, digits or underscores.")

    def save(name, inputs, result):
        if type(result) not in (int, float) or (type(result) is float and not math.isfinite(result)):
            raise NumericalFault("NONFINITE", f"{name} must be finite.")
        trace.add(f"{prefix}_{name}", inputs, {name: result})
        return result

    trace.add(f"{prefix}_raw", state, state)
    w, tau = state["w"], state["tau"]
    complement = save("complement", dict(one=1.0, w=w), 1.0 - w)
    products, scores = [], []
    rows = ("A0", "A1", "B0", "B1")
    for row, offset in zip(rows, (0, 2, 4, 6)):
        s0, s1 = state[RAW_KEYS[offset]], state[RAW_KEYS[offset + 1]]
        p = save(f"product{row}0", dict(w=w, score=s0), w * s0)
        q = save(f"product{row}1", dict(complement=complement, score=s1), complement * s1)
        score = save(f"score{row}", dict(product0=p, product1=q), p + q)
        products.extend((p, q))
        scores.append(score)
    means = []
    for response, offset in (("A", 0), ("B", 2)):
        total = save(f"sum{response}", dict(annotator0=scores[offset], annotator1=scores[offset + 1]),
                     scores[offset] + scores[offset + 1])
        means.append(save(f"mean{response}", dict(total=total, two=2.0), total / 2.0))
    criterion_means = []
    for response, offset in (("A", 0), ("B", 4)):
        for criterion in (0, 1):
            a = state[RAW_KEYS[offset + criterion]]
            b = state[RAW_KEYS[offset + 2 + criterion]]
            total = save(f"criterionSum{response}{criterion}", dict(annotator0=a, annotator1=b), a + b)
            criterion_means.append(save(f"criterionMean{response}{criterion}", dict(total=total, two=2.0), total / 2.0))
    ranks = []
    for name, a, b in (("annotator0", scores[0], scores[2]),
                       ("annotator1", scores[1], scores[3]), ("mean", means[0], means[1])):
        rank = 1 if a > b else -1 if a < b else 0
        ranks.append(save(f"rank_{name}", dict(scoreA=a, scoreB=b), rank))
    passes = []
    for name, score in zip((*rows, "meanA", "meanB"), (*scores, *means)):
        passes.append(save(f"pass_{name}", dict(score=score, tau=tau), 1 if score >= tau else 0))
    criterion_difference, criterion_disagreement = [], []
    for response, offset in (("A", 0), ("B", 4)):
        for criterion in (0, 1):
            a = state[RAW_KEYS[offset + criterion]]
            b = state[RAW_KEYS[offset + 2 + criterion]]
            difference = save(f"criterionDifference{response}{criterion}", dict(annotator0=a, annotator1=b), a - b)
            criterion_difference.append(difference)
            criterion_disagreement.append(save(f"criterionDisagreement{response}{criterion}", dict(difference=difference), abs(difference)))
    aggregate_difference, aggregate_disagreement = [], []
    for response, offset in (("A", 0), ("B", 2)):
        a, b = scores[offset], scores[offset + 1]
        difference = save(f"aggregateDifference{response}", dict(annotator0=a, annotator1=b), a - b)
        aggregate_difference.append(difference)
        aggregate_disagreement.append(save(f"aggregateDisagreement{response}", dict(difference=difference), abs(difference)))
    gradient = []
    for row, offset in zip(rows, (0, 2, 4, 6)):
        a, b = state[RAW_KEYS[offset]], state[RAW_KEYS[offset + 1]]
        gradient.append(save(f"weightGradient{row}", dict(criterion0=a, criterion1=b), a - b))
    for response, offset in (("A", 0), ("B", 2)):
        a, b = gradient[offset], gradient[offset + 1]
        total = save(f"weightGradientSum{response}", dict(annotator0=a, annotator1=b), a + b)
        gradient.append(save(f"weightGradientMean{response}", dict(total=total, two=2.0), total / 2.0))
    a, b = ranks[:2]
    category = 0 if a == 0 and b == 0 else 2 if a == 0 or b == 0 else 3 if a == b else 1
    category = save("annotatorAgreementCategory", dict(annotator0Rank=a, annotator1Rank=b), category)
    return dict(state=state, complement=complement, products=products, scores=scores,
                means=means, criterion_means=criterion_means, ranks=ranks, passes=passes,
                criterion_difference=criterion_difference,
                criterion_disagreement=criterion_disagreement,
                aggregate_difference=aggregate_difference,
                aggregate_disagreement=aggregate_disagreement,
                weight_gradient=gradient, category=category)


def _storage(captured):
    """Detached row-major storage only; no NumPy arithmetic or public metadata."""
    return dict(raw=np.array(list(captured["state"].values()), dtype=np.float64),
                products=np.array(captured["products"], dtype=np.float64).reshape(2, 2, 2),
                scores=np.array(captured["scores"], dtype=np.float64).reshape(2, 2),
                means=np.array(captured["means"], dtype=np.float64),
                criterion_means=np.array(captured["criterion_means"], dtype=np.float64).reshape(2, 2),
                ranks=np.array(captured["ranks"], dtype=np.int32),
                passes=np.array(captured["passes"], dtype=np.int32),
                criterion_difference=np.array(captured["criterion_difference"], dtype=np.float64).reshape(2, 2),
                criterion_disagreement=np.array(captured["criterion_disagreement"], dtype=np.float64).reshape(2, 2),
                aggregate_difference=np.array(captured["aggregate_difference"], dtype=np.float64),
                aggregate_disagreement=np.array(captured["aggregate_disagreement"], dtype=np.float64),
                weight_gradient=np.array(captured["weight_gradient"], dtype=np.float64))


class _RubricTrace:
    """Six-field public frames; capture both numeric sides once before capacity."""

    def __init__(self):
        self.steps = []
        self._ids = set()

    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.")
        saved_inputs = _numeric_record(inputs, f"{identifier}.inputs")
        saved_outputs = _numeric_record(outputs, f"{identifier}.outputs")
        if len(self.steps) >= 512:
            raise NumericalFault("UNSUPPORTED_SIZE", "At most 512 operations are supported.")
        self.steps.append(deepcopy(dict(id=identifier, label=label, equation=equation,
            explanation=explanation, inputs=saved_inputs, outputs=saved_outputs)))
        self._ids.add(identifier)


def rubric_trace():
    return _RubricTrace()


_FRAME_PROSE = {
    "complement": (
        "Save the context-fit weight once", "complement=1-w",
        "One actual rounded subtraction supplies every context-fit product. Do not reconstruct an ideal complement or simplify a later score."),
    "score": (
        "Combine two criterion ratings for one annotator", "product0=w*score0; product1=complement*score1; score=product0+product1",
        "Compute both products, including at zero weights, then add their actual saved values. A rating is an invented rubric judgment, not a probability or observed model behavior."),
    "mean": (
        "Average the two saved annotator scores", "sum=annotator0+annotator1; mean=sum/2",
        "Each response mean divides its actual two-score sum by the literal positive two exactly once. A mean can conceal disagreement between annotators."),
    "criterionMean": (
        "Keep one criterion visible across annotators", "sum=annotator0+annotator1; mean=sum/2",
        "Average the two raw ratings for this response and criterion. Clarity is criterion zero and context fit is criterion one; no weight is applied again."),
    "rank": (
        "Compare the actual saved A and B scores", "rank=scoreA>scoreB?1:scoreA<scoreB?-1:0",
        "Comparisons zero and one use their annotator scores; comparison two uses response means. A tie is explicit, with no epsilon, ideal-gap shortcut or tie-to-A rule."),
    "agreement": (
        "Distinguish ties from strict ranking agreement or reversal", "category=bothTie?0:oneTie?2:sameStrict?3:1",
        "Category zero means both tie; one means opposite strict orders; two means one tie and one strict order; three means the same strict order. Only the two annotator ranks enter; the mean rank is separate."),
    "pass": (
        "Apply the inclusive rubric threshold", "pass=score>=tau?1:0",
        "Equality passes. This flag describes the chosen threshold for an authored rating matrix; it is neither a safety label nor a probability, and it has no claimed derivative."),
    "criterionDisagreement": (
        "Measure disagreement before combining criteria", "difference=annotator0-annotator1; disagreement=abs(difference)",
        "Subtract the raw annotator ratings in annotator-zero minus annotator-one order, then take the absolute value. This retains criterion-level disagreement that weighted aggregation can conceal."),
    "aggregateDisagreement": (
        "Measure disagreement after combining criteria", "difference=annotator0-annotator1; disagreement=abs(difference)",
        "Use the actual saved weighted scores. Opposing criterion differences can cancel, so a small aggregate disagreement does not establish criterion agreement or annotator correctness."),
    "weightGradient": (
        "Differentiate the real weighted score with respect to w", "gradient=score0-score1",
        "Hold the integer ratings fixed. This is the formal derivative of the real affine score, not a derivative of the rounded complement, score labels, ranks or threshold decisions."),
    "meanGradient": (
        "Average the two formal score sensitivities", "sum=annotator0+annotator1; gradient=sum/2",
        "Use the actual two stored formal derivatives in response order, add, then divide by positive two. No optimizer, model update or gradient of a discrete assessment is involved."),
}

_TENSOR_SCHEMA = (
    ("Raw", (10,), ("RawField",), "raw", "Actual ten raw numeric words in scoreA00,scoreA01,scoreA10,scoreA11,scoreB00,scoreB01,scoreB10,scoreB11,w,tau order, including score negative zeros; integer admission does not normalize copies."),
    ("Complement", (1,), ("ComplementField",), "complement", "Actual once-computed binary64 context-fit weight 1-w, reused by all four context-fit products."),
    ("Products", (2, 2, 2), ("Response", "Annotator", "ProductField"), "products", "Actual product0=w*clarity then product1=complement*contextFit, in response A/B then annotator0/1 order; both products are evaluated even at zero weights."),
    ("Scores", (2, 2), ("Response", "Annotator"), "scores", "Actual saved sums product0+product1 in A0,A1,B0,B1 order; no algebraic score substitution."),
    ("Means", (2,), ("Response",), "means", "Actual saved two-annotator score sums divided by positive two, response A then B."),
    ("CriterionMeans", (2, 2), ("Response", "Criterion"), "criterion_means", "Actual raw-rating sums divided by positive two in A clarity,A context fit,B clarity,B context fit order; no second weighting."),
    ("Ranks", (3,), ("Comparison",), "ranks", "Actual three-way rank codes for annotator0,annotator1,mean; +1 A,0 tie,-1 B, all integer VALUE roles."),
    ("Passes", (6,), ("ThresholdTarget",), "passes", "Actual inclusive threshold flags in A0,A1,B0,B1,meanA,meanB order; all integer VALUE roles."),
    ("CriterionDifference", (2, 2), ("Response", "Criterion"), "criterion_difference", "Actual signed raw-rating differences annotator0-annotator1 in A clarity,A context fit,B clarity,B context fit order."),
    ("CriterionDisagreement", (2, 2), ("Response", "Criterion"), "criterion_disagreement", "Actual absolute values of the four saved criterion differences in response then criterion order; abs of either signed zero is positive zero."),
    ("AggregateDifference", (2,), ("Response",), "aggregate_difference", "Actual signed weighted-score differences annotator0-annotator1, response A then B; criterion cancellation can reduce these differences."),
    ("AggregateDisagreement", (2,), ("Response",), "aggregate_disagreement", "Actual absolute values of the two saved aggregate differences, response A then B; these do not replace criterion-level disagreement."),
    ("WeightGradient", (6,), ("ScoreTarget",), "weight_gradient", "Actual formal real w derivatives in A0,A1,B0,B1,meanA,meanB order; four raw criterion differences then two stored-gradient means, all floating WORD roles."),
)


def evaluate_rubric(value, trace, prefix):
    """Serialize saved independent FIRST operands/results in adopted public order.

    Trusted observer callbacks occur AFTER full scalar capture, unlike TS's
    interleaved callbacks. Exceptions escape unchanged; no backend is branded.
    """
    private = _operand_trace()
    captured = _evaluate_rubric_mechanics(value, private, prefix)
    frames = {step["id"]: step for step in private.steps}

    def frame(name):
        return frames[f"{prefix}_{name}"]

    def output(name):
        return frame(name)["outputs"][name]

    def emit(suffix, family, inputs, outputs):
        trace.add(f"{prefix}_{suffix}", *_FRAME_PROSE[family],
                  deepcopy(inputs), deepcopy(outputs))

    emit("complement", "complement", frame("complement")["inputs"],
         dict(complement=output("complement")))
    for row in ("A0", "A1", "B0", "B1"):
        first, second = frame(f"product{row}0"), frame(f"product{row}1")
        emit(f"score_{row}", "score",
             dict(w=first["inputs"]["w"], score0=first["inputs"]["score"],
                  complement=second["inputs"]["complement"], score1=second["inputs"]["score"]),
             dict(product0=output(f"product{row}0"), product1=output(f"product{row}1"),
                  score=output(f"score{row}")))
    for response in ("A", "B"):
        emit(f"mean_{response}", "mean",
             dict(**frame(f"sum{response}")["inputs"], two=frame(f"mean{response}")["inputs"]["two"]),
             dict(sum=output(f"sum{response}"), mean=output(f"mean{response}")))
    for response in ("A", "B"):
        for criterion in (0, 1):
            key = f"{response}{criterion}"
            emit(f"criterionMean_{key}", "criterionMean",
                 dict(**frame(f"criterionSum{key}")["inputs"], two=frame(f"criterionMean{key}")["inputs"]["two"]),
                 dict(sum=output(f"criterionSum{key}"), mean=output(f"criterionMean{key}")))
    for index, name in enumerate(("annotator0", "annotator1", "mean")):
        emit(f"rank_{index}", "rank", frame(f"rank_{name}")["inputs"],
             dict(rank=output(f"rank_{name}")))
    agreement = frame("annotatorAgreementCategory")
    emit("agreement", "agreement",
         dict(rank0=agreement["inputs"]["annotator0Rank"], rank1=agreement["inputs"]["annotator1Rank"]),
         agreement["outputs"])
    for target in ("A0", "A1", "B0", "B1", "meanA", "meanB"):
        emit(f"pass_{target}", "pass", frame(f"pass_{target}")["inputs"],
             {"pass": output(f"pass_{target}")})
    for response in ("A", "B"):
        for criterion in (0, 1):
            key = f"{response}{criterion}"
            emit(f"criterionDisagreement_{key}", "criterionDisagreement",
                 frame(f"criterionDifference{key}")["inputs"],
                 dict(difference=output(f"criterionDifference{key}"), disagreement=output(f"criterionDisagreement{key}")))
    for response in ("A", "B"):
        emit(f"aggregateDisagreement_{response}", "aggregateDisagreement",
             frame(f"aggregateDifference{response}")["inputs"],
             dict(difference=output(f"aggregateDifference{response}"), disagreement=output(f"aggregateDisagreement{response}")))
    for row in ("A0", "A1", "B0", "B1"):
        saved = frame(f"weightGradient{row}")["inputs"]
        emit(f"weightGradient_{row}", "weightGradient",
             dict(score0=saved["criterion0"], score1=saved["criterion1"]),
             dict(gradient=output(f"weightGradient{row}")))
    for response in ("A", "B"):
        emit(f"weightGradient_mean{response}", "meanGradient",
             dict(**frame(f"weightGradientSum{response}")["inputs"], two=frame(f"weightGradientMean{response}")["inputs"]["two"]),
             dict(sum=output(f"weightGradientSum{response}"), gradient=output(f"weightGradientMean{response}")))
    storage = _storage(captured)
    storage["complement"] = np.array([captured["complement"]], dtype=np.float64)
    tensors = []
    for suffix, shape, axes, key, provenance in _TENSOR_SCHEMA:
        discrete = key in ("ranks", "passes")
        tensors.append(dict(id=f"{prefix}_{suffix}", shape=list(shape), axes=list(axes),
            dtype="int32" if discrete else "float64", values=storage[key].reshape(-1).tolist(),
            provenance=provenance, precision=0 if discrete else 8))
    return deepcopy(dict(state=captured["state"], complement=captured["complement"],
        products=captured["products"], scores=captured["scores"], means=captured["means"],
        criterionMeans=captured["criterion_means"], ranks=captured["ranks"], passes=captured["passes"],
        criterionDifference=captured["criterion_difference"], criterionDisagreement=captured["criterion_disagreement"],
        aggregateDifference=captured["aggregate_difference"], aggregateDisagreement=captured["aggregate_disagreement"],
        weightGradient=captured["weight_gradient"], tensors=tensors))

2. iv58.py: the complete result and the command-line boundary

iv58.py loads the adjacent helper by a path relative to its own file, under the single helper identity iv58_rubric_reference. It does not search for a different chapter’s helper. derive_iv58(value) adds setup and finish around the helper’s saved evaluation. Its complete result contains status, outputs, steps, tensors and texts. The first four outputs are the same four summaries shown above the controls, followed by an alias for every saved operation output. An alias here is another named copy of that output, not another arithmetic operation. Full metadata, explanations, axes and text evidence travel with the numerical record. Python uses detached mutable copies; the TypeScript snapshots are also detached and are deeply frozen.

For later use, the command-line entry point is run() with zero parameters; it reads command-line arguments itself. No argument chooses the full stated default. One JSON argument supplies a complete replacement of all ten fields; - reads that replacement from standard input. A partial object such as an object containing only w is invalid. strict_json rejects duplicate keys, malformed JSON, nonfinite constants and floating tokens that overflow, while preserving a literal -0 as -0.0.

A known parse or input fault is returned as JSON containing status="unavailable", a code and a reason, with exit status 0. That status means a handled query, not a successful assessment or a passed check. An unknown option or wrong number of arguments prints usage and exits 2. Unexpected programmer, resource and unknown semantic errors propagate; they are not converted into plausible results. Successful results must still be interpreted within the rubric’s limits.

Ordinary imports, helper calls and queries invoke no self-checks. Only the explicit --self-check branch calls source_self_check(), outside the parsing and input-fault catches. Its assertions require assertions enabled; a failing check must escape rather than look like a handled bad input. The presence of assert statements is source evidence, not a result or an independent whole-record sensitivity verdict.

Optional: observer timing and the explicit check inventory

An observer receives saved operation records. Python captures the whole scalar graph before sending its public observer callbacks; TypeScript sends callbacks between calculation phases. Their public record order is the adopted order, but their callback timing differs. These are trusted structural observers, not a claim that every possible callback interaction behaves identically across languages.

The zero-argument source_self_check calls these nine zero-argument functions, all declared in iv58.py, in order: check_raw_guards, check_observer_guards_and_identity, check_hand_cases_and_storage, check_rounding_counterexamples_and_score_sensitivity, check_cli_boundary_and_check_isolation, check_public_binding, check_public_observer_and_once_capture, check_public_endpoints, check_query_isolation_and_parser_identity. The helper declares no check dispatcher. These bodies cover invalid inputs, words and copies, hand cases, rounding, public records, endpoints and the distinction between ordinary queries and deliberate checks. These check declarations are distinct from execution results and from numerical parity, independent verification, rendering, accessibility and offline checks.

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.

"""IV58 canonical public root, strict CLI and explicit checks; all checks UNRUN.

Exactly one adjacent project helper is loaded by its file-relative identity.
Ordinary imports and queries call no checks.
"""
import importlib.util
import json
from pathlib import Path
import sys

_HELPER_PATH = Path(__file__).resolve().with_name("rubric_reference.py")
_SPEC = importlib.util.spec_from_file_location("iv58_rubric_reference", _HELPER_PATH)
if _SPEC is None or _SPEC.loader is None:
    raise ImportError("Cannot load the adjacent IV58 rubric helper.")
_reference = importlib.util.module_from_spec(_SPEC)
_SPEC.loader.exec_module(_reference)
DEFAULT_IV58 = _reference.DEFAULT_IV58
NumericalFault = _reference.NumericalFault
rubric_state = _reference.rubric_state


class ParseFault(ValueError):
    """Only known JSON syntax/carrier faults enter the CLI parse-fault branch."""


def strict_json(source):
    """Full replacement JSON; reject duplicates/nonfinite tokens, preserve -0."""
    def pairs(entries):
        saved = {}
        for key, value in entries:
            if key in saved:
                raise ParseFault("Duplicate JSON object key.")
            saved[key] = value
        return saved

    def constant(_token):
        raise ParseFault("Nonfinite JSON constant.")

    def integer(token):
        if token == "-0":
            return -0.0
        try:
            return int(token)
        except ValueError as fault:
            raise ParseFault("JSON integer exceeds the supported parser size.") from fault

    def floating(token):
        value = float(token)
        if not _reference.math.isfinite(value):
            raise ParseFault("Nonfinite JSON number.")
        return value

    try:
        return json.loads(source, object_pairs_hook=pairs,
                          parse_constant=constant, parse_int=integer, parse_float=floating)
    except json.JSONDecodeError as fault:
        raise ParseFault(str(fault)) from fault


def run():
    """Stable zero-argument CLI; explicit check failures escape all fault catches."""
    args = sys.argv[1:]
    if args == ["--self-check"]:
        source_self_check()
        print("IV58 explicit checks completed.")
        return 0
    if len(args) > 1 or (args and args[0].startswith("--")):
        print("Usage: iv58.py [JSON|-|--self-check]", file=sys.stderr)
        return 2
    if not args:
        value = dict(DEFAULT_IV58)
    else:
        source = sys.stdin.read() if args[0] == "-" else args[0]
        try:
            value = strict_json(source)
        except ParseFault as fault:
            print(json.dumps(dict(status="unavailable", code="INVALID_INPUT", reason=str(fault)), allow_nan=False))
            return 0
    print(json.dumps(derive_iv58(value), allow_nan=False))
    return 0


def _evaluate(value=None, prefix="check", trace=None):
    observer = _reference._operand_trace() if trace is None else trace
    result = _reference._evaluate_rubric_mechanics(
        dict(DEFAULT_IV58) if value is None else value, observer, prefix)
    return result, observer


def _same_words(actual, expected):
    assert len(actual) == len(expected)
    assert all(type(value) is float for value in actual)
    assert all(_reference._word(a) == _reference._word(b) for a, b in zip(actual, expected))


def _expect_fault(code, operation, *args):
    try:
        operation(*args)
    except NumericalFault as fault:
        assert fault.code == code
    else:
        raise AssertionError(f"Expected known fault {code}.")


def check_raw_guards():
    raw = dict(DEFAULT_IV58)
    _same_words(list(rubric_state(raw).values()), list(DEFAULT_IV58.values()))
    for key in _reference.RAW_KEYS:
        for bad in (True, False, None, "0", float("nan"), float("inf"), -float("inf")):
            _expect_fault("NONFINITE", rubric_state, dict(raw, **{key: bad}))
        _expect_fault("INVALID_INPUT", rubric_state, {k: v for k, v in raw.items() if k != key})
        _expect_fault("INVALID_INPUT", rubric_state, dict(raw, **{key: 10 ** 1000}))
        _expect_fault("INVALID_INPUT", rubric_state, dict(raw, **{key: -(10 ** 1000)}))
        saved = rubric_state(dict(raw, **{key: -0.0}))
        _same_words([saved[key]], [-0.0])
    for key in _reference.RAW_KEYS[:8]:
        for bad in (-1, 3, 0.5):
            _expect_fault("INVALID_INPUT", rubric_state, dict(raw, **{key: bad}))
    for key, bad in (("w", -0.01), ("w", 1.01), ("tau", -0.01), ("tau", 2.01)):
        _expect_fault("INVALID_INPUT", rubric_state, dict(raw, **{key: bad}))
    _expect_fault("NONFINITE", rubric_state, dict(raw, scoreA00=3.0, tau=float("nan")))
    _expect_fault("NONFINITE", _reference._evaluate_rubric_mechanics,
                  dict(raw, tau=float("nan")), _reference._operand_trace(), "bad\n")
    for value in (None, [], dict(raw, extra=0.0), dict(raw, **{"other": 0.0})):
        _expect_fault("INVALID_INPUT", rubric_state, value)
    class DictSubclass(dict):
        def __getitem__(self, key):
            raise AssertionError("A rejected mapping must not be read.")
    _expect_fault("INVALID_INPUT", rubric_state, DictSubclass(raw))
    for w in (0.0, 1.0):
        for key in _reference.RAW_KEYS[:8]:
            _expect_fault("INVALID_INPUT", rubric_state, dict(raw, w=w, **{key: 3.0}))
    for prefix in ("", "1bad", "bad-name", "bad\n", "é", None):
        _expect_fault("INVALID_INPUT", _reference._evaluate_rubric_mechanics,
                      raw, _reference._operand_trace(), prefix)
    for prefix in ("rubric", "v3Plus", "v3Minus", "A_09"):
        _evaluate(prefix=prefix)


def check_observer_guards_and_identity():
    trace = _reference._operand_trace()
    inputs, outputs = dict(zero=-0.0), dict(flag=1)
    trace.add("one", inputs, outputs)
    inputs["zero"], outputs["flag"] = 2.0, 0
    _same_words([trace.steps[0]["inputs"]["zero"]], [-0.0])
    assert trace.steps[0]["outputs"] == dict(flag=1)
    _expect_fault("INVALID_INPUT", trace.add, "one", dict(x=float("nan")), {})
    _expect_fault("NONFINITE", trace.add, "two", {}, dict(x=float("nan")))
    assert len(trace.steps) == 1
    full = _reference._operand_trace()
    for index in range(512):
        full.add(f"frame{index}", {}, {})
    _expect_fault("NONFINITE", full.add, "overflow", {}, dict(x=float("inf")))
    _expect_fault("UNSUPPORTED_SIZE", full.add, "overflow", {}, {})
    _expect_fault("INVALID_INPUT", full.add, "frame0", dict(x=float("nan")), {})
    assert len(full.steps) == 512
    class Observer:
        def __init__(self):
            self.steps = []
        def add(self, identifier, inputs, outputs):
            self.steps.append(dict(id=identifier, inputs=inputs.copy(), outputs=outputs.copy()))
    captured, structural = _evaluate(trace=Observer())
    assert captured["ranks"] == [1, -1, 1]
    assert structural.steps[0]["id"] == "check_raw"
    for fault in (RuntimeError("unknown observer error"), NumericalFault("OTHER", "observer semantic identity")):
        class BrokenObserver:
            def add(self, identifier, inputs, outputs):
                raise fault
        try:
            _evaluate(trace=BrokenObserver())
        except Exception as caught:
            assert caught is fault
        else:
            raise AssertionError("Observer exception identity was lost.")


def check_hand_cases_and_storage():
    captured, trace = _evaluate()
    _same_words(captured["products"], [1.5, 0.0, 0.75, 0.5, 0.0, 0.5, 1.5, 0.25])
    _same_words(captured["scores"], [1.5, 1.25, 0.5, 1.75])
    _same_words(captured["means"], [1.375, 1.125])
    _same_words(captured["criterion_means"], [1.5, 1.0, 1.0, 1.5])
    _same_words(captured["criterion_difference"], [1.0, -2.0, -2.0, 1.0])
    _same_words(captured["criterion_disagreement"], [1.0, 2.0, 2.0, 1.0])
    _same_words(captured["aggregate_difference"], [0.25, -1.25])
    _same_words(captured["aggregate_disagreement"], [0.25, 1.25])
    _same_words(captured["weight_gradient"], [2.0, -1.0, -2.0, 1.0, 0.5, -0.5])
    assert captured["ranks"] == [1, -1, 1] and captured["category"] == 1
    assert captured["passes"] == [1, 1, 0, 1, 1, 0]
    by_id = {frame["id"]: frame for frame in trace.steps}
    assert by_id["check_rank_annotator0"]["inputs"] == dict(scoreA=1.5, scoreB=0.5)
    assert by_id["check_pass_A1"]["inputs"] == dict(score=1.25, tau=1.25)
    assert by_id["check_annotatorAgreementCategory"]["inputs"] == dict(annotator0Rank=1, annotator1Rank=-1)
    for w, means, ranks, category in ((0.25, [1.125, 1.375], [-1, 1, -1], 1),
                                      (0.5, [1.25, 1.25], [0, 0, 0], 0),
                                      (0.0, [1.0, 1.5], [-1, 1, -1], 1),
                                      (1.0, [1.5, 1.0], [1, -1, 1], 1)):
        result, _ = _evaluate(dict(DEFAULT_IV58, w=w))
        _same_words(result["means"], means)
        assert result["ranks"] == ranks and result["category"] == category
        if w == 0.5:
            assert result["passes"][4:] == [1, 1]
    for tau, flags in ((0.0, [1, 1]), (2.0, [0, 0]), (1.125, [1, 1]), (1.375, [1, 0])):
        result, _ = _evaluate(dict(DEFAULT_IV58, tau=tau))
        assert result["passes"][4:] == flags
        _same_words(result["means"], captured["means"])
    one_tie = dict.fromkeys(_reference.RAW_KEYS, 0.0)
    one_tie.update(w=0.75, tau=1.25, scoreA10=2.0)
    result, _ = _evaluate(one_tie)
    assert result["ranks"] == [0, 1, 1] and result["category"] == 2
    same_strict = dict(DEFAULT_IV58)
    for key in _reference.RAW_KEYS[:8]:
        same_strict[key] = 2.0 if key.startswith("scoreA") else 0.0
    result, _ = _evaluate(same_strict)
    assert result["ranks"] == [1, 1, 1] and result["category"] == 3
    all_zero = dict.fromkeys(_reference.RAW_KEYS, -0.0)
    result, negative_trace = _evaluate(all_zero)
    _same_words(list(result["state"].values()), [-0.0] * 10)
    _same_words(result["products"], [0.0, -0.0] * 4)
    _same_words(result["scores"], [0.0] * 4)
    _same_words(result["criterion_disagreement"], [0.0] * 4)
    _same_words(list(negative_trace.steps[0]["outputs"].values()), [-0.0] * 10)
    storage = _reference._storage(result)
    assert storage["raw"].dtype.name == "float64"
    assert storage["products"].shape == (2, 2, 2)
    assert storage["scores"].shape == (2, 2)
    assert storage["criterion_means"].shape == (2, 2)
    assert storage["ranks"].dtype.name == "int32"
    assert storage["passes"].dtype.name == "int32"
    _same_words(storage["raw"].tolist(), [-0.0] * 10)
    result["state"]["scoreA00"] = 2.0
    _same_words(storage["raw"].tolist(), [-0.0] * 10)


def check_rounding_counterexamples_and_score_sensitivity():
    raw = dict(DEFAULT_IV58, w=float.fromhex("0x1.0000000000003p-3"))
    result, _ = _evaluate(raw)
    _same_words([result["complement"]], [float.fromhex("0x1.bffffffffffffp-1")])
    _same_words([result["scores"][1]], [float.fromhex("0x1.dffffffffffffp+0")])
    assert _reference._word(result["scores"][1]) != _reference._word(2.0 - raw["w"])
    result, _ = _evaluate(dict(DEFAULT_IV58, w=float.fromhex("0x1.fffffffffffffp-2")))
    _same_words([result["complement"]], [0.5])
    _same_words(result["scores"], [float.fromhex("0x1.fffffffffffffp-1"), 1.5, 1.0, 1.5])
    _same_words(result["means"], [1.25, 1.25])
    assert result["ranks"] == [-1, 0, 0] and result["category"] == 2
    center, _ = _evaluate()
    plus, _ = _evaluate(dict(DEFAULT_IV58, w=769.0 / 1024.0), prefix="v3Plus")
    minus, _ = _evaluate(dict(DEFAULT_IV58, w=767.0 / 1024.0), prefix="v3Minus")
    _same_words(plus["scores"], [1538.0 / 1024.0, 1279.0 / 1024.0, 510.0 / 1024.0, 1793.0 / 1024.0])
    _same_words(minus["scores"], [1534.0 / 1024.0, 1281.0 / 1024.0, 514.0 / 1024.0, 1791.0 / 1024.0])
    _same_words(plus["means"], [2817.0 / 2048.0, 2303.0 / 2048.0])
    _same_words(minus["means"], [2815.0 / 2048.0, 2305.0 / 2048.0])
    for key in _reference.RAW_KEYS:
        if key != "w":
            _same_words([plus["state"][key], minus["state"][key]], [center["state"][key]] * 2)
    denominator = 2.0 * (1.0 / 1024.0)
    quotient = [(a - b) / denominator for a, b in zip(
        plus["scores"] + plus["means"], minus["scores"] + minus["means"])]
    _same_words(quotient, [2.0, -1.0, -2.0, 1.0, 0.5, -0.5])
    _same_words(quotient, center["weight_gradient"])
    assert (plus["passes"][1], minus["passes"][1], center["passes"][1]) == (0, 1, 1)
    # Mechanism check only: no full public central/endpoint packet verdict here.


def check_cli_boundary_and_check_isolation():
    import contextlib
    import io
    for source in ('{"w":0,"w":1}', "NaN", "Infinity", "-Infinity", "1e9999", "-1e9999", "{", "{} trailing"):
        try:
            strict_json(source)
        except ParseFault:
            pass
        else:
            raise AssertionError("Malformed/ambiguous JSON was accepted.")
    _same_words(list(strict_json('{"score":-0,"weight":-0.0}').values()), [-0.0, -0.0])
    assert strict_json("1") == 1 and strict_json("null") is None
    old_argv, old_stdin = sys.argv, sys.stdin
    old_derive, old_check, old_parser = derive_iv58, source_self_check, strict_json
    calls = []
    def fake_derive(value):
        calls.append(value)
        return dict(captured=value)
    def bomb():
        raise AssertionError("Ordinary CLI must not run checks.")
    try:
        globals()["derive_iv58"], globals()["source_self_check"] = fake_derive, bomb
        for args, stdin, expected in (([], "", dict(DEFAULT_IV58)),
                                      (["{}"], "", {}), (["-"], "{\"w\":-0}", {"w": -0.0})):
            sys.argv, sys.stdin = ["iv58.py", *args], io.StringIO(stdin)
            with contextlib.redirect_stdout(io.StringIO()):
                assert run() == 0
            assert calls[-1] == expected
            if args == ["-"]:
                _same_words([calls[-1]["w"]], [-0.0])
        for args in (["--bad"], ["{}", "{}"], ["--self-check", "{}"]):
            sys.argv = ["iv58.py", *args]
            with contextlib.redirect_stderr(io.StringIO()):
                assert run() == 2
        sys.argv = ["iv58.py", "{"]
        out = io.StringIO()
        before = len(calls)
        with contextlib.redirect_stdout(out):
            assert run() == 0
        assert len(calls) == before
        assert json.loads(out.getvalue())["code"] == "INVALID_INPUT"
        for fault in (RuntimeError("unknown derive"), NumericalFault("OTHER", "uncaught semantic")):
            def broken_derive(value):
                raise fault
            globals()["derive_iv58"] = broken_derive
            sys.argv = ["iv58.py", "{}"]
            try:
                run()
            except Exception as caught:
                assert caught is fault
            else:
                raise AssertionError("Unknown derive exception was swallowed.")
        parser_fault = RuntimeError("unknown parser")
        def broken_parser(source):
            raise parser_fault
        globals()["strict_json"] = broken_parser
        try:
            run()
        except RuntimeError as caught:
            assert caught is parser_fault
        else:
            raise AssertionError("Unknown parser exception was swallowed.")
        sys.argv = ["iv58.py", "--self-check"]
        try:
            run()
        except AssertionError as caught:
            assert str(caught) == "Ordinary CLI must not run checks."
        else:
            raise AssertionError("Explicit check failure was swallowed.")
    finally:
        globals()["derive_iv58"], globals()["source_self_check"], globals()["strict_json"] = old_derive, old_check, old_parser
        sys.argv, sys.stdin = old_argv, old_stdin
    fault = derive_iv58({})
    assert list(fault) == ["status", "code", "reason"] and fault["status"] == "unavailable"
    assert derive_iv58(dict(DEFAULT_IV58))["status"] == "defined"

def source_self_check():
    """Explicit dispatch only. No imports/helpers/queries call any check node."""
    if not __debug__:
        raise RuntimeError("Explicit source checks require assertions enabled.")
    check_raw_guards()
    check_observer_guards_and_identity()
    check_hand_cases_and_storage()
    check_rounding_counterexamples_and_score_sensitivity()
    check_cli_boundary_and_check_isolation()
    check_public_binding()
    check_public_observer_and_once_capture()
    check_public_endpoints()
    check_query_isolation_and_parser_identity()




rubric_trace = _reference.rubric_trace
evaluate_rubric = _reference.evaluate_rubric


def derive_iv58(value):
    """Complete adopted root; only known numerical faults become unavailable."""
    try:
        raw = rubric_state(value)
        trace = rubric_trace()
        trace.add("setup", "Set up two authored responses and a fictional rating matrix",
            "raw=[scoreA00,scoreA01,scoreA10,scoreA11,scoreB00,scoreB01,scoreB10,scoreB11,w,tau]; responses=2; annotators=2; criteria=2",
            "The same short-break prompt and responses as IV57 receive invented clarity and context-fit ratings from two fictional annotators. Keep every raw numeric word, then evaluate the rubric without running or updating a model.",
            raw, dict(raw, responseCount=2, annotatorCount=2, criterionCount=2, rawInputCount=10))
        evaluated = evaluate_rubric(raw, trace, "rubric")
        tensors = evaluated["tensors"]
        category = next(step["outputs"]["annotatorAgreementCategory"] for step in trace.steps
                        if step["id"] == "rubric_agreement")
        summaries = dict(meanScoreA=evaluated["means"][0], meanScoreB=evaluated["means"][1],
                         meanRank=evaluated["ranks"][2], annotatorAgreementCategory=category)
        work = dict(complementSubtractions=1, scoreMultiplications=8, scoreAdditions=4,
            responseMeanAdditions=2, responseMeanDivisions=2, criterionMeanAdditions=4, criterionMeanDivisions=4,
            rankDecisions=3, agreementClassifications=1, thresholdComparisons=6,
            criterionDifferenceSubtractions=4, criterionAbsoluteValues=4, aggregateDifferenceSubtractions=2, aggregateAbsoluteValues=2,
            weightGradientSubtractions=4, meanGradientAdditions=2, meanGradientDivisions=2,
            nativeElementaryCalls=0, modelRuns=0, optimizerSteps=0, frames=len(trace.steps) + 1, tensorCount=len(tensors))
        trace.add("finish", "Report saved response means, mean rank and annotator ranking category",
            "meanScoreA=means[0]; meanScoreB=means[1]; meanRank=ranks[2]; annotatorAgreementCategory=savedAgreementCategory",
            "All four summaries copy the complete saved evaluation. A mean rank is separate from agreement between the two annotators. Source counts describe the declared calculation, not measurements of hardware, reliability, training or safety.",
            dict(meanA=evaluated["means"][0], meanB=evaluated["means"][1], rank=evaluated["ranks"][2], savedAgreementCategory=category),
            dict(summaries, **work))
        category_labels = ["both tie", "opposite strict orders", "one tie and one strict order", "same strict order"]
        texts = dict(
            prompt="Suggest a short break",
            responseLabels=["A", "B"],
            responseTexts=["Stretch your arms for a moment", "Look away from your screen for a moment"],
            annotatorLabels=["Fictional annotator 0", "Fictional annotator 1"],
            criterionLabels=["Clarity", "Context fit"],
            contextPolicy="The prompt and both responses are authored examples shared with IV57. Eight editable integer ratings belong to two fictional annotators and two invented criteria. They are not observed model outputs, human-study data, probabilities or validated safety labels.",
            inputPolicy="Provide exactly ten own data fields on an ordinary or null-prototype object. Check all descriptors, then all ten actual finite numbers, then all eight integer score domains [0,2], w in [0,1] and tau in [0,2], in raw order. No coercion, clipping, accessors, partial defaults or skipped zero-weight criteria. Every numeric raw copy retains its word, including score, w and tau negative zeros.",
            shapePolicy="Raw ratings use response A/B, annotator0/1, criterion clarity/contextFit row-major order. Products are [Response=2,Annotator=2,ProductField=2]; weighted scores [Response=2,Annotator=2]; response means [Response=2]; criterion tables [Response=2,Criterion=2]. Three comparisons are annotator0,annotator1,mean. Six threshold and score-sensitivity targets are A0,A1,B0,B1,meanA,meanB. No token, batch, model or parameter axis is implied.",
            scorePolicy="Save complement=1-w once. For A0,A1,B0,B1, compute product0=w*score0, product1=complement*score1, then score=product0+product1, in that order. Both products execute at w zero or one. Reuse the actual complement and products; do not simplify a row or renormalize the weights.",
            meanPolicy="For A then B, add the two saved annotator scores and divide by positive two. Next, for A clarity,A context fit,B clarity,B context fit, add the two raw annotator ratings and divide by positive two. These criterion means are unweighted views of the same matrix; no second weighting or hidden mean is applied.",
            rankPolicy="Compare the actual stored A and B operands for annotator0,annotator1 and the response means: +1 means A higher,0 tie,-1 B higher. No epsilon or ideal-score gap replaces the comparison. Agreement category0 means both tie,1 opposite strict orders,2 one tie and one strict order,3 the same strict order. Only the two annotator ranks define that category; the mean rank remains separate.",
            thresholdPolicy="The six flags compare actual A0,A1,B0,B1,meanA,meanB scores against tau with inclusive >=. Equality passes. They describe this chosen rubric threshold, not truth, calibrated confidence or safety. No pass counts or rates are computed, and ranks and thresholds have no claimed derivative.",
            disagreementPolicy="For each response and criterion subtract raw annotator1 from raw annotator0, then take the absolute value. Separately subtract their saved weighted scores, then take that absolute value. Criterion differences can cancel during aggregation: a small aggregate disagreement need not mean agreement on clarity or context fit, and neither measure identifies a correct annotator.",
            gradientPolicy="Hold all eight rating words fixed. Four formal derivatives of the real affine scores with respect to w are score0-score1 in A0,A1,B0,B1 order. Add each response pair of saved derivatives and divide by positive two for meanA and meanB. These six sensitivities are not derivatives of binary64 rounding, integer rating choices, tau, ranks, pass flags or absolute-value kinks. No optimizer or model update is performed.",
            zeroPolicy="All ten raw numbers, state fields, operands and copies use WORD comparison, including score negative zero admitted by integer VALUE membership. Arithmetic keeps its actual signs: 1-(-0) gives positive one, multiplication and division can preserve negative zero, opposite-zero addition gives positive zero, and abs gives positive zero. Rank codes, flags, categories, counts and indices use VALUE. Display rounding or ordinary JSON conversion of -0 to0 cannot establish a word-preserving capture.",
            numericPolicy="Each stated arithmetic primitive is a separate finite binary64 round-to-nearest ties-to-even operation, with no contraction or reassociation. Save actual inputs and outputs once on both sides of each factory frame. Observers are trusted structurally, not branded. There are no exp, log, native elementary-function admission tolerances, hidden model calls or sampled observations. Display precision never feeds computation.",
            boundsPolicy="With admitted ratings0,1,2, the actual rounded complement lies in [0,1] and exact w+complement lies in [1-2^-54,1+2^-54], which rounds to1. Multiplication by2 is exact here, so monotonicity bounds every actual weighted score and mean in [0,2]. Criterion means lie in {0,0.5,1,1.5,2}, and disagreement magnitudes are at most2. These are bounds, not permission to replace literal operations or clamp an output.",
            counterexamplePolicy="For unchanged default ratings, let u=2^-55 and w=1/8+3u. The saved complement is7/8-4u, and actual A1 is15/8-8u, whereas simplifying to RN(2-w) gives15/8. At w=1/2-2^-54, the complement rounds to1/2: annotator0 ranks B, annotator1 ties and both means round to5/4. Real formulas alone therefore cannot determine binary64 ranks near a tie.",
            diagnosticPolicy="The prior score-only centered-difference claim is restricted to exactly all ten default raw words, w=3/4 and h=2^-10, for all six targets A0,A1,B0,B1,meanA,meanB together. Verify the whole actual central record first, then complete fresh v3Plus/v3Minus helper records, traces, tensors, nine unchanged raw words, actual endpoints and quotients before a zero verdict. Plus A1 fails tau while minus and central A1 pass, central at equality. This is a score sensitivity, never a decision gradient or a zero-budget claim for other states.",
            computePolicy="Counts describe the declared scalar graph, three rank decisions, one agreement classification and six threshold comparisons. Frames include setup and finish, and tensorCount includes every pure-helper tensor. There is no total tensor-count cap, native call, model run or optimizer step. Snapshot and alias storage copies are not arithmetic work or hardware measurements. No pass count is hidden in the interface.",
            limitsPolicy="The IV57 training objective and this rubric proxy are different quantities: rubric ratings are neither log-probabilities nor losses. A lower objective does not imply higher rubric scores or safer behavior. Changing weights can reverse a ranking without changing response text; choosing weights or thresholds after viewing examples can overfit this proxy, as in III35. Two invented responses and annotators are no held-out population, empirical agreement study or alignment guarantee. Mathematical record consistency does not authenticate physical execution or rubric validity.",
            provenance="Self-authored fixed prompt, two benign responses, fictional annotators, clarity/context-fit criteria and editable integer scores. The chapter evaluates a transparent rubric and its limits without running a model, measuring behavior, training or certifying safety. Runtime validation remains deferred under the FluxGeo hold.",
            rawFields=list(_reference.RAW_KEYS), responseKeys=["A", "B"], annotatorKeys=["0", "1"], criterionKeys=["clarity", "contextFit"],
            productFields=["product0", "product1"], comparisonKeys=["annotator0", "annotator1", "mean"],
            thresholdTargetKeys=["A0", "A1", "B0", "B1", "meanA", "meanB"], scoreTargetKeys=["A0", "A1", "B0", "B1", "meanA", "meanB"],
            rankLabels=["B (-1)", "Tie (0)", "A (+1)"], agreementCategoryLabels=category_labels,
            rankResults=["A" if rank == 1 else "B" if rank == -1 else "tie" for rank in evaluated["ranks"]],
            agreementCategory=category_labels[category], passResults=["pass" if flag == 1 else "fail" for flag in evaluated["passes"]],
            integerValuePolicy="Only rubric_Ranks and rubric_Passes use int32 precision0; all other tensors use float64 precision8 and every numeric cell is WORD, including all ten rubric_Raw cells. In trace operands, rank0/rank1 and finish rank/savedAgreementCategory are VALUE; every other helper input is WORD. Trace rank, pass, category, setup counts and finish work-count outputs are VALUE; all raw, arithmetic, gradient and mean-summary outputs are WORD. The four primary summaries are WORD,WORD,VALUE,VALUE. Aliases retain their source roles. Exact ordered keys, IDs, labels, equations, explanations, axes, provenance and text require structured/string equality.")
        outputs = summaries.copy()
        for step in trace.steps:
            for key, entry in step["outputs"].items():
                alias = f"{step['id']}_{key}"
                if alias in outputs:
                    raise RuntimeError("IV58 output aliases must be unique.")
                outputs[alias] = entry
        return _reference.deepcopy(dict(status="defined", outputs=outputs, steps=trace.steps, tensors=tensors, texts=texts))
    except NumericalFault as fault:
        if fault.code not in ("INVALID_INPUT", "NONFINITE", "SHAPE_MISMATCH", "UNSUPPORTED_SIZE"):
            raise
        return dict(status="unavailable", code=fault.code, reason=str(fault))


def check_public_binding():
    raw = dict(DEFAULT_IV58)
    trace = rubric_trace()
    result = evaluate_rubric(raw, trace, "rubric")
    assert list(result) == ["state", "complement", "products", "scores", "means", "criterionMeans", "ranks", "passes",
        "criterionDifference", "criterionDisagreement", "aggregateDifference", "aggregateDisagreement", "weightGradient", "tensors"]
    ids = ["rubric_complement", *[f"rubric_score_{row}" for row in ("A0", "A1", "B0", "B1")],
        "rubric_mean_A", "rubric_mean_B", *[f"rubric_criterionMean_{key}" for key in ("A0", "A1", "B0", "B1")],
        "rubric_rank_0", "rubric_rank_1", "rubric_rank_2", "rubric_agreement",
        *[f"rubric_pass_{key}" for key in ("A0", "A1", "B0", "B1", "meanA", "meanB")],
        *[f"rubric_criterionDisagreement_{key}" for key in ("A0", "A1", "B0", "B1")],
        "rubric_aggregateDisagreement_A", "rubric_aggregateDisagreement_B",
        *[f"rubric_weightGradient_{row}" for row in ("A0", "A1", "B0", "B1")],
        "rubric_weightGradient_meanA", "rubric_weightGradient_meanB"]
    assert len(trace.steps) == 33 and [step["id"] for step in trace.steps] == ids
    assert sum(len(step["outputs"]) for step in trace.steps) == 55
    expected = (
        ("Raw", [10], ["RawField"], list(DEFAULT_IV58.values())),
        ("Complement", [1], ["ComplementField"], [0.25]),
        ("Products", [2, 2, 2], ["Response", "Annotator", "ProductField"], [1.5, 0.0, 0.75, 0.5, 0.0, 0.5, 1.5, 0.25]),
        ("Scores", [2, 2], ["Response", "Annotator"], [1.5, 1.25, 0.5, 1.75]),
        ("Means", [2], ["Response"], [1.375, 1.125]),
        ("CriterionMeans", [2, 2], ["Response", "Criterion"], [1.5, 1.0, 1.0, 1.5]),
        ("Ranks", [3], ["Comparison"], [1, -1, 1]),
        ("Passes", [6], ["ThresholdTarget"], [1, 1, 0, 1, 1, 0]),
        ("CriterionDifference", [2, 2], ["Response", "Criterion"], [1.0, -2.0, -2.0, 1.0]),
        ("CriterionDisagreement", [2, 2], ["Response", "Criterion"], [1.0, 2.0, 2.0, 1.0]),
        ("AggregateDifference", [2], ["Response"], [0.25, -1.25]),
        ("AggregateDisagreement", [2], ["Response"], [0.25, 1.25]),
        ("WeightGradient", [6], ["ScoreTarget"], [2.0, -1.0, -2.0, 1.0, 0.5, -0.5]))
    assert len(result["tensors"]) == 13 and sum(len(t["values"]) for t in result["tensors"]) == 56
    for tensor, (suffix, shape, axes, values) in zip(result["tensors"], expected):
        assert list(tensor) == ["id", "shape", "axes", "dtype", "values", "provenance", "precision"]
        assert tensor["id"] == f"rubric_{suffix}" and tensor["shape"] == shape and tensor["axes"] == axes
        discrete = suffix in ("Ranks", "Passes")
        assert tensor["dtype"] == ("int32" if discrete else "float64") and tensor["precision"] == (0 if discrete else 8)
        assert type(tensor["provenance"]) is str and tensor["provenance"]
        if discrete:
            assert tensor["values"] == values and all(type(v) is int for v in tensor["values"])
        else:
            _same_words(tensor["values"], values)
    for step in trace.steps:
        assert list(step) == ["id", "label", "equation", "explanation", "inputs", "outputs"]
        assert all(type(step[key]) is str and step[key] for key in ("id", "label", "equation", "explanation"))
    assert trace.steps[1]["inputs"] == dict(w=0.75, score0=2.0, complement=0.25, score1=0.0)
    assert trace.steps[1]["outputs"] == dict(product0=1.5, product1=0.0, score=1.5)
    assert trace.steps[1]["equation"] == "product0=w*score0; product1=complement*score1; score=product0+product1"
    assert trace.steps[14]["inputs"] == dict(rank0=1, rank1=-1)
    assert trace.steps[14]["outputs"] == dict(annotatorAgreementCategory=1)
    root = derive_iv58(raw)
    assert list(root) == ["status", "outputs", "steps", "tensors", "texts"] and root["status"] == "defined"
    assert len(root["steps"]) == 35 and [s["id"] for s in root["steps"]] == ["setup", *ids, "finish"]
    assert root["steps"][1:-1] == trace.steps and root["tensors"] == result["tensors"]
    outputs = root["outputs"]
    assert len(outputs) == 99 and list(outputs)[:4] == ["meanScoreA", "meanScoreB", "meanRank", "annotatorAgreementCategory"]
    _same_words([outputs["meanScoreA"], outputs["meanScoreB"]], [1.375, 1.125])
    assert (outputs["meanRank"], outputs["annotatorAgreementCategory"]) == (1, 1)
    aliases = []
    for step in root["steps"]:
        for key, value in step["outputs"].items():
            alias = f"{step['id']}_{key}"
            aliases.append(alias)
            assert type(outputs[alias]) is type(value)
            if type(value) is float:
                _same_words([outputs[alias]], [value])
            else:
                assert outputs[alias] == value
    assert list(outputs)[4:] == aliases and len(set(aliases)) == 95
    work_keys = ["complementSubtractions", "scoreMultiplications", "scoreAdditions", "responseMeanAdditions", "responseMeanDivisions",
        "criterionMeanAdditions", "criterionMeanDivisions", "rankDecisions", "agreementClassifications", "thresholdComparisons",
        "criterionDifferenceSubtractions", "criterionAbsoluteValues", "aggregateDifferenceSubtractions", "aggregateAbsoluteValues",
        "weightGradientSubtractions", "meanGradientAdditions", "meanGradientDivisions", "nativeElementaryCalls", "modelRuns", "optimizerSteps", "frames", "tensorCount"]
    assert list(root["steps"][-1]["outputs"])[4:] == work_keys
    assert [root["steps"][-1]["outputs"][key] for key in work_keys] == [1, 8, 4, 2, 2, 4, 4, 3, 1, 6, 4, 4, 2, 2, 4, 2, 2, 0, 0, 0, 35, 13]
    assert list(root["texts"]) == ["prompt", "responseLabels", "responseTexts", "annotatorLabels", "criterionLabels", "contextPolicy",
        "inputPolicy", "shapePolicy", "scorePolicy", "meanPolicy", "rankPolicy", "thresholdPolicy", "disagreementPolicy", "gradientPolicy",
        "zeroPolicy", "numericPolicy", "boundsPolicy", "counterexamplePolicy", "diagnosticPolicy", "computePolicy", "limitsPolicy", "provenance",
        "rawFields", "responseKeys", "annotatorKeys", "criterionKeys", "productFields", "comparisonKeys", "thresholdTargetKeys", "scoreTargetKeys",
        "rankLabels", "agreementCategoryLabels", "rankResults", "agreementCategory", "passResults", "integerValuePolicy"]
    assert root["texts"]["rankResults"] == ["A", "B", "A"] and root["texts"]["agreementCategory"] == "opposite strict orders"
    assert root["texts"]["passResults"] == ["pass", "pass", "fail", "pass", "pass", "fail"]
    assert root["texts"]["responseTexts"] == ["Stretch your arms for a moment", "Look away from your screen for a moment"]
    result["state"]["scoreA00"] = 0.0
    result["scores"][0] = 0.0
    result["tensors"][0]["values"][0] = 0.0
    raw["scoreA00"] = 0.0
    _same_words([trace.steps[1]["inputs"]["score0"], trace.steps[1]["outputs"]["score"], root["tensors"][0]["values"][0]], [2.0, 1.5, 2.0])
    for key in _reference.RAW_KEYS:
        negative = dict(DEFAULT_IV58, **{key: -0.0})
        public_trace = rubric_trace()
        public = evaluate_rubric(negative, public_trace, "rubric")
        negative_root = derive_iv58(negative)
        _same_words([public["state"][key], public["tensors"][0]["values"][_reference.RAW_KEYS.index(key)],
            negative_root["steps"][0]["inputs"][key], negative_root["steps"][0]["outputs"][key],
            negative_root["outputs"][f"setup_{key}"]], [-0.0] * 5)
    assert derive_iv58({}) == dict(status="unavailable", code="INVALID_INPUT",
        reason="state must have exactly scoreA00, scoreA01, scoreA10, scoreA11, scoreB00, scoreB01, scoreB10, scoreB11, w, tau as own fields.")


def check_public_observer_and_once_capture():
    trace = rubric_trace()
    inputs, outputs = dict(x=-0.0), dict(flag=1)
    trace.add("one", "label", "equation", "explanation", inputs, outputs)
    inputs["x"], outputs["flag"] = 2.0, 0
    _same_words([trace.steps[0]["inputs"]["x"]], [-0.0])
    assert trace.steps[0]["outputs"] == dict(flag=1)
    _expect_fault("INVALID_INPUT", trace.add, "one", "l", "e", "x", dict(x=float("nan")), {})
    _expect_fault("NONFINITE", trace.add, "two", "l", "e", "x", {}, dict(x=float("nan")))
    old_number = _reference._number
    reads = []
    def counted_number(value, label):
        reads.append(label)
        return old_number(value, label)
    try:
        _reference._number = counted_number
        trace.add("capture", "l", "e", "x", dict(a=-0.0), dict(b=1.0))
        assert reads == ["capture.inputs.a", "capture.outputs.b"]
        reads.clear()
        _expect_fault("INVALID_INPUT", trace.add, "capture", "l", "e", "x", dict(a=float("nan")), {})
        assert reads == []
    finally:
        _reference._number = old_number
    full = rubric_trace()
    for i in range(512):
        full.add(f"frame{i}", "l", "e", "x", {}, {})
    _expect_fault("NONFINITE", full.add, "overflow", "l", "e", "x", {}, dict(x=float("inf")))
    _expect_fault("UNSUPPORTED_SIZE", full.add, "overflow", "l", "e", "x", {}, {})
    _expect_fault("INVALID_INPUT", full.add, "frame0", "l", "e", "x", dict(x=float("nan")), {})
    assert len(full.steps) == 512
    for prefix in ("", "é", "1bad", "bad\n", "bad-name", None):
        _expect_fault("INVALID_INPUT", evaluate_rubric, dict(DEFAULT_IV58), rubric_trace(), prefix)
    _expect_fault("NONFINITE", evaluate_rubric, dict(DEFAULT_IV58, scoreA00=3.0, tau=float("nan")), rubric_trace(), "bad\n")
    raw = dict(DEFAULT_IV58)
    class Observer:
        def __init__(self):
            self.steps = []
        def add(self, identifier, label, equation, explanation, inputs, outputs):
            self.steps.append(dict(id=identifier, label=label, equation=equation, explanation=explanation,
                                   inputs=inputs.copy(), outputs=outputs.copy()))
            raw["scoreA00"] = 0.0
            inputs.clear()
            outputs.clear()
    observer = Observer()
    result = evaluate_rubric(raw, observer, "external")
    assert len(observer.steps) == 33 and observer.steps[14]["id"] == "external_agreement"
    _same_words(result["scores"], [1.5, 1.25, 0.5, 1.75])
    _same_words([result["state"]["scoreA00"]], [2.0])
    for fault in (RuntimeError("public observer"), NumericalFault("OTHER", "unknown semantic"), MemoryError("resource")):
        class BrokenObserver:
            def add(self, identifier, label, equation, explanation, inputs, outputs):
                raise fault
        try:
            evaluate_rubric(dict(DEFAULT_IV58), BrokenObserver(), "external")
        except Exception as caught:
            assert caught is fault
        else:
            raise AssertionError("Public observer exception identity was lost.")
    old = globals()["evaluate_rubric"]
    try:
        for fault in (NumericalFault("OTHER", "unknown semantic"), RuntimeError("programmer"), MemoryError("resource")):
            def broken(value, trace, prefix):
                raise fault
            globals()["evaluate_rubric"] = broken
            try:
                derive_iv58(dict(DEFAULT_IV58))
            except Exception as caught:
                assert caught is fault
            else:
                raise AssertionError("Unknown root exception was swallowed.")
    finally:
        globals()["evaluate_rubric"] = old


def check_public_endpoints():
    center_trace = rubric_trace()
    center = evaluate_rubric(dict(DEFAULT_IV58), center_trace, "rubric")
    central_root = derive_iv58(dict(DEFAULT_IV58))
    endpoints = []
    for prefix, w, scores, means, flag in (
        ("v3Plus", 769.0 / 1024.0, [1538.0 / 1024.0, 1279.0 / 1024.0, 510.0 / 1024.0, 1793.0 / 1024.0], [2817.0 / 2048.0, 2303.0 / 2048.0], 0),
        ("v3Minus", 767.0 / 1024.0, [1534.0 / 1024.0, 1281.0 / 1024.0, 514.0 / 1024.0, 1791.0 / 1024.0], [2815.0 / 2048.0, 2305.0 / 2048.0], 1)):
        raw = dict(DEFAULT_IV58, w=w)
        trace = rubric_trace()
        endpoint = evaluate_rubric(raw, trace, prefix)
        root = derive_iv58(raw)
        assert len(endpoint) == 14 and len(trace.steps) == 33 and len(root["steps"]) == 35
        assert len(endpoint["tensors"]) == 13 and len(root["outputs"]) == 99 and len(root["texts"]) == 36
        _same_words(endpoint["scores"], scores)
        _same_words(endpoint["means"], means)
        _same_words(endpoint["weightGradient"], [2.0, -1.0, -2.0, 1.0, 0.5, -0.5])
        assert endpoint["passes"][1] == flag and root["outputs"]["rubric_pass_A1_pass"] == flag
        for key in _reference.RAW_KEYS:
            _same_words([endpoint["state"][key]], [raw[key]])
            if key != "w":
                _same_words([endpoint["state"][key]], [center["state"][key]])
        for actual, central_step, root_step in zip(trace.steps, center_trace.steps, root["steps"][1:-1]):
            suffix = actual["id"][len(prefix):]
            assert central_step["id"] == root_step["id"] == f"rubric{suffix}"
            assert list(actual) == list(central_step) == list(root_step)
            for key in ("label", "equation", "explanation"):
                assert actual[key] == central_step[key] == root_step[key]
            assert actual["inputs"] == root_step["inputs"] and actual["outputs"] == root_step["outputs"]
        for actual, central_tensor, root_tensor in zip(endpoint["tensors"], center["tensors"], root["tensors"]):
            assert actual["id"][len(prefix):] == central_tensor["id"][6:] == root_tensor["id"][6:]
            for key in ("shape", "axes", "dtype", "provenance", "precision"):
                assert actual[key] == central_tensor[key] == root_tensor[key]
            if actual["dtype"] == "float64":
                _same_words(actual["values"], root_tensor["values"])
            else:
                assert actual["values"] == root_tensor["values"]
        for key, text in root["texts"].items():
            if key not in ("rankResults", "agreementCategory", "passResults"):
                assert text == central_root["texts"][key]
        endpoints.append(endpoint)
    denominator = 2.0 * (1.0 / 1024.0)
    quotient = [(a - b) / denominator for a, b in zip(endpoints[0]["scores"] + endpoints[0]["means"],
                                                     endpoints[1]["scores"] + endpoints[1]["means"])]
    _same_words(quotient, center["weightGradient"])
    assert center["passes"][1] == 1
    # Self-check of actual full sources, not an independent packet verdict.




def check_query_isolation_and_parser_identity():
    import contextlib
    import io
    names = ("source_self_check", "check_raw_guards", "check_observer_guards_and_identity", "check_hand_cases_and_storage",
        "check_rounding_counterexamples_and_score_sensitivity", "check_cli_boundary_and_check_isolation", "check_public_binding",
        "check_public_observer_and_once_capture", "check_public_endpoints", "check_query_isolation_and_parser_identity")
    saved = {name: globals()[name] for name in names}
    argv, stdin = sys.argv, sys.stdin
    marker = NumericalFault("OTHER", "check invocation escaped")
    def forbidden():
        raise marker
    try:
        for name in names:
            globals()[name] = forbidden
        assert evaluate_rubric(dict(DEFAULT_IV58), rubric_trace(), "noChecks")["ranks"] == [1, -1, 1]
        assert derive_iv58(dict(DEFAULT_IV58))["status"] == "defined"
        assert derive_iv58({})["status"] == "unavailable"
        for args, source, status in (([], "", "defined"), ([json.dumps(dict(DEFAULT_IV58))], "", "defined"),
                                      (["-"], json.dumps(dict(DEFAULT_IV58)), "defined"), (["{}"], "", "unavailable"),
                                      (["{"], "", "unavailable"), (["NaN"], "", "unavailable"),
                                      (["1e9999"], "", "unavailable"), (["{" + '"w":0,"w":1' + "}"], "", "unavailable")):
            sys.argv, sys.stdin = ["iv58.py", *args], io.StringIO(source)
            out = io.StringIO()
            with contextlib.redirect_stdout(out):
                assert run() == 0
            assert json.loads(out.getvalue())["status"] == status
        sys.argv = ["iv58.py", "--self-check"]
        try:
            run()
        except NumericalFault as caught:
            assert caught is marker
        else:
            raise AssertionError("Explicit semantic check failure was caught as an input fault.")
    finally:
        globals().update(saved)
        sys.argv, sys.stdin = argv, stdin
    old_int = globals().get("int")
    had_int = "int" in globals()
    try:
        for fault in (ValueError("digit limit"), RuntimeError("parser programmer"), MemoryError("parser resource")):
            def integer_failure(token):
                raise fault
            globals()["int"] = integer_failure
            try:
                strict_json("1")
            except ParseFault as caught:
                assert type(fault) is ValueError and caught.__cause__ is fault
                assert str(caught) == "JSON integer exceeds the supported parser size."
            except Exception as caught:
                assert type(fault) is not ValueError and caught is fault
            else:
                raise AssertionError("Parser boundary failed to preserve exception identity.")
        _same_words([strict_json("-0")], [-0.0])
    finally:
        if had_int:
            globals()["int"] = old_int
        else:
            globals().pop("int", None)
    assert derive_iv58(dict(DEFAULT_IV58, scoreA00=10 ** 1000))["code"] == "INVALID_INPUT"


if __name__ == "__main__":
    raise SystemExit(run())

Recap and next step

  • A training objective defines what optimization rewards; an evaluation proxy measures a chosen substitute; observed behavior needs an actual system observation with provenance.
  • Two criteria and two annotators are different axes. Weight criteria first, then average annotators, preserving both products and the mean divisions.
  • Ranks, ties and inclusive threshold decisions describe different comparisons. A weight or threshold can change the assessment without changing either authored answer.
  • Criterion disagreements can cancel in an aggregate. Preserve their signed differences and magnitudes, and compare actual saved scores after rounding.
  • A real score’s weight derivative does not differentiate a jumping pass flag or guarantee alignment or safety.

Return to IV-57 — Preference Data and Optimization Objectives to connect this limit to the preference objective, or III-35 — Cross-Validation and Hyperparameter Tuning to review evaluation selection. Part XV turns to modern LLM architectures: changing how a model is built adds new mechanisms to inspect, while the need to separate objectives, proxies and observed behavior remains.