/teal-sea
teal-sea / zeta-labstate of record · compiled 28 Sep 2026 · revision e4945c4 · source

Library · hunts/r_e2ee73/RESULTS.md

Hunt R-E2EE73: Scope caveat: compiler verdicts rest on a hand-written model, not LLVM semantics (Alive2 absent)

1,251 words · 104 lines · source

Summary

This hunt establishes, measures, and records the exact scope caveats bounding all claims made by the compiler/ department.

Because Alive2 (alive-tv) is absent on this machine, the department's refinement verdicts rest on a pure-Python, hand-written interpreter (pymodel.refinement_i8, rung 2) rather than LLVM's formal SMT-based semantics (rung 3). The exposure of this hand-written model is bounded through an exhaustive two-backend cross-check against compiled Clang binaries (clang.exhaustive_i8, rung 1) across all 10 fixtures (655,360 total points evaluated, 0 mismatches), combined with explicit ModelUnsupported exception barriers on out-of-scope IR constructs.

1. Backend Census: The Evidence Ladder

BackendStatusRungImplementation / ToolScope / What it Establishes
clang.exhaustive_i8available1Apple Clang (/usr/bin/clang) compiling -x irConcrete output agreement over all 65536 (i8, i8) pairs at -O0 and -O2. Blind to poison and undef.
pymodel.refinement_i8available2Hand-written Python model in compiler/semantics.pyExhaustive refinement over 65536 points with first-class poison and immediate UB modeling for the supported subset.
alive2.refinementABSENT3alive-tv (not on PATH)Formal refinement under full LLVM semantics via SMT/Z3. Unavailable.

Every verdict emitted by compiler.semantics returns an explicit evidence caveat (EVIDENCE_EXHAUSTIVE_I8 or EVIDENCE_MODEL_I8) so no consumer can cite a passing result without quoting its semantic regime.

2. Two-Backend Cross-Check (655,360 Comparable Points)

Where both backends can speak (at all inputs where the hand-written model claims a defined value), the compiled output of Apple Clang at both -O0 and -O2 must match bit-for-bit.

Across all 10 fixtures in compiler/fixtures/, the cross-check demonstrates exact agreement:

FixtureFileComparable PointsClang -O0 / -O2 MismatchesOverall Agreement
host_srccompiler/fixtures/host_src.ll65,5360100.0000%
host_tgtcompiler/fixtures/host_tgt.ll65,5360100.0000%
mul2_add_srccompiler/fixtures/mul2_add_src.ll65,5360100.0000%
mul2_add_tgtcompiler/fixtures/mul2_add_tgt.ll65,5360100.0000%
sdiv2_add_srccompiler/fixtures/sdiv2_add_src.ll65,5360100.0000%
sdiv2_add_tgtcompiler/fixtures/sdiv2_add_tgt.ll65,5360100.0000%
slt_srccompiler/fixtures/slt_src.ll65,5360100.0000%
slt_sub_tgtcompiler/fixtures/slt_sub_tgt.ll65,5360100.0000%
udiv4_add_srccompiler/fixtures/udiv4_add_src.ll65,5360100.0000%
udiv4_add_tgtcompiler/fixtures/udiv4_add_tgt.ll65,5360100.0000%
Total10 fixtures655,3600100.0000%

3. Detector Power and the Measured Blind Spot

The boundary between rung 1 and rung 2 is measured by evaluating both detectors against the 4 planted lesions in compiler.catalog:

LesionDeclared MagnitudeConcrete Run Disagreements (clang.exhaustive_i8)Model Violations (pymodel.refinement_i8)Model Violation Breakdown (Value / Poison / UB)Status
signed_to_unsigned_predicate0.50000032,768 (0.500000)32,768 (0.500000)32,768 value / 0 poison / 0 UBDetected by both
strict_to_nonstrict_predicate0.003906256 (0.003906)256 (0.003906)256 value / 0 poison / 0 UBDetected by both
single_point_special_case0.0000151 (0.000015)1 (0.000015)1 value / 0 poison / 0 UBDetected by both
nsw_flag_on_a_wrapping_shift0.5000000 (0.000000)32,768 (0.500000)0 value / 32,768 poison / 0 UBConcrete detector BLIND; Model detector FULL POWER

The concrete detector has has_power = False with blind_to = ('nsw_flag_on_a_wrapping_shift',). The model detector has has_power = True with blind_to = ().

4. Calibration: Rivals, Decoys, and Surrogates

All battery calibration checks re-derive from first principles:

5. Rejection Safety: Unsupported IR Taxonomy

The hand-written model must refuse out-of-scope IR constructs rather than guessing. An audit of unsupported constructs confirms safe rejection:

ConstructExample ProbeBehaviorException Raised
Floating point arithmeticfadd i8 %x, %yRejectedModelUnsupported (unimplemented opcode)
Memory operationsalloca, load, storeRejectedModelUnsupported (unrecognised line)
Control flow / CFGbr label %nextRejectedModelUnsupported (unrecognised line)
Phi nodesphi i8 [ %x, %t ], [ %y, %f ]RejectedModelUnsupported (unrecognised line)
Freeze instructionfreeze i8 %xRejectedModelUnsupported (unrecognised line)
Non-deterministic undefundef operandRejectedModelUnsupported (unrecognised line)

Every raised exception is a subclass of IRRejected, ensuring consumers treating backend refusals uniformly stay correct.

6. Verification Path Independence

Formal comparison of VerificationPath declarations between the two backends:

7. Settlement and Boundaries

  1. What is settled:
  2. The standing scope limitation is documented, quantified, and bounded.
  3. Refinement verdicts hold exclusively over the enumerated i8 domain with respect to the hand-written model (EVIDENCE_MODEL_I8).
  4. The hand-written model's defined-value claims are cross-checked across 655,360 points against Apple Clang with 0 mismatches.
  5. The model reliably catches the poison hazard that concrete execution cannot see (32,768 poison violations on nsw_flag_on_a_wrapping_shift).
  6. The model safely rejects out-of-scope IR with ModelUnsupported.
  1. What cannot be settled within budget:
  2. Installing Alive2 (alive-tv): Alive2 requires a full LLVM toolchain build with Z3 SMT solver libraries, which is absent from this container environment. Without alive-tv on PATH, rung 3 cannot be made available.

Loose threads

  1. Bitwidth Handling in Parser vs Evaluator: The regex parser _LINE_BINOP matches arbitrary integer widths (e.g. i32), but _eval_program hardcodes %x and %y inputs as 8-bit unsigned values in range(-128, 128). An IR function declared with i32 signature parses and evaluates without raising ModelUnsupported, but tests only an 8-bit slice of the 32-bit input space. This could allow multi-byte integer semantics to be evaluated inadvertently under a truncated 8-bit harness. The first step would be to restrict the regex parser in _parse to accept only i8 (and i1 for conditions), raising ModelUnsupported on wider types.
  1. SMT / Z3 Bounded Refinement Alternative: z3-solver can be installed via Python without building full alive-tv. An SMT-based straight-line solver for the supported subset would provide symbolic proof over arbitrary bitwidths as an intermediate rung between Python enumeration and full Alive2.