MS0V4 mlir-stage-05-v1 passing 1000/1000
Baseline tests: Every tracked test file with a RUN line invoking loom-raise-opt (77 files); other executables and native unit tests excluded
| Source file | Baseline coverage | Baseline + input | Contributing input |
|---|---|---|---|
…/lib/Frontend/Raising/ExactStandardSpelling.hMS0V | 112/118lines94.9% 62/82branches75.6% | 114/118lines96.6%+2 64/82branches78.0%+2 | |
2 newly covered lines · 2 newly covered branches125 | |||
…/lib/Frontend/Raising/MaterializeFMulAddPass.cppMS0V | 70/106lines66.0% 11/26branches42.3% | 71/106lines67.0%+1 12/26branches46.2%+1 | |
1 newly covered line · 1 newly covered branch175 | |||
…/lib/Dataflow/Transforms/DataflowRewritePass.cppMS0V | 338/559lines60.5% 172/340branches50.6% | 338/559lines60.5%+0 172/340branches50.6%+0 | Open PBT |
…/lib/Frontend/Lowering/ExpandGraphMemrefCopyPass.cppMS0V | 79/90lines87.8% 20/22branches90.9% | 79/90lines87.8%+0 20/22branches90.9%+0 | Open PBT |
…/lib/Frontend/Lowering/LowerForToGraphPass.cppMS0V | 1033/1240lines83.3% 374/540branches69.3% | 1033/1240lines83.3%+0 374/540branches69.3%+0 | Open PBT |
…/lib/Frontend/Lowering/LowerForallToThreadPass.cppMS0V | 30/34lines88.2% 2/4branches50.0% | 30/34lines88.2%+0 2/4branches50.0%+0 | Open PBT |
…/lib/Frontend/Lowering/LowerGraphConstantsPass.cppMS0V | 80/83lines96.4% 18/24branches75.0% | 80/83lines96.4%+0 18/24branches75.0%+0 | Open PBT |
…/lib/Frontend/Lowering/LowerGraphMemoryPass.cppMS0V | 525/841lines62.4% 208/400branches52.0% | 525/841lines62.4%+0 208/400branches52.0%+0 | Open PBT |
…/lib/Frontend/Lowering/Pipeline.cppMS0V | 18/21lines85.7% branchesnot measured | 18/21lines85.7%+0 branchesnot measured | Open PBT |
…/lib/Frontend/Raising/CallableRegions.hMS0V | 32/34lines94.1% 12/16branches75.0% | 32/34lines94.1%+0 12/16branches75.0%+0 | Open PBT |
…/lib/Frontend/Raising/DeduplicateSCFWhileStatePass.cppMS0V | 13/135lines9.6% 0/60branches0.0% | 13/135lines9.6%+0 0/60branches0.0%+0 | Open PBT |
…/lib/Frontend/Raising/LLVMArithToArithPass.cppMS0V | 300/319lines94.0% 94/116branches81.0% | 300/319lines94.0%+0 94/116branches81.0%+0 | Open PBT |
…/lib/Frontend/Raising/LLVMCfToCfPass.cppMS0V | 77/80lines96.2% 8/8branches100.0% | 77/80lines96.2%+0 8/8branches100.0%+0 | Open PBT |
…/lib/Frontend/Raising/LiftCFToSCFPass.cppMS0V | 616/694lines88.8% 293/386branches75.9% | 616/694lines88.8%+0 293/386branches75.9%+0 | Open PBT |
…/lib/Frontend/Raising/NormalizeLiftedSCFExitPass.cppMS0V | 232/250lines92.8% 120/182branches65.9% | 232/250lines92.8%+0 120/182branches65.9%+0 | Open PBT |
…/lib/Frontend/Raising/Pipeline.cppMS0V | 10/19lines52.6% branchesnot measured | 10/19lines52.6%+0 branchesnot measured | Open PBT |
…/lib/Frontend/Raising/SCFForToForallPass.cppMS0V | 494/738lines66.9% 241/458branches52.6% | 494/738lines66.9%+0 241/458branches52.6%+0 | Open PBT |
…/lib/Frontend/Raising/SCFWhileToForPass.cppMS0V | 164/176lines93.2% 70/94branches74.5% | 164/176lines93.2%+0 70/94branches74.5%+0 | Open PBT |
…/loom/tools/loom-raise-opt/loom-raise-opt.cppMS0V | 12/12lines100.0% branchesnot measured | 12/12lines100.0%+0 branchesnot measured | Open PBT |
Each child preserves the exact floating type, fast-math contract, source location, Ownership lineage, and source-provenance projection. It is verified and finalized through the sole Structured Program finalizer before publication to the output set. Schedule and MemoryCommunication may then form further
module { llvm.func @blocked_0(%x: f32, %y: f32, %z: f32) -> f32 attributes {no_signed_zeros_fp_math = true} { %b0 = llvm.intr.fmuladd(%x, %y, %z) : (f32, f32, f32) -> f32 loc("fmuladd_blocked_0") llvm.return %x : f32 } }
module { llvm.func @blocked_0(%x: f64, %y: f64, %z: f64) -> f64 attributes {passthrough = ["strictfp"]} { %b0 = llvm.intr.fmuladd(%x, %y, %z) : (f64, f64, f64) -> f64 loc("fmuladd_blocked_0") llvm.return %x : f64 } llvm.func @plain_1(%x: f16, %y: f16, %z: f16) -> f16 { %r1_0 = llvm.intr.fmuladd(%x, %y, %z) {fastmathFlags = #llvm.fastmath<fast>} : (f16, f16, f16) -> f16 loc("fmuladd_1_0") llvm.return %x : f16 } llvm.func @blocked_2(%x: f32, %y: f32, %z: f32) -> f32 attributes {reciprocal_estimates = "all"} { %b2 = llvm.intr.fmuladd(%x, %y, %z) : (f32, f32, f32) -> f32 loc("fmuladd_blocked_2") llvm.return %x : f32 } }
The current Structured ExecutionShape generator consumes a finite set of exact Structured Program references. An empty input set produces an empty output set.
llvm.intr.fmuladd remains unchanged in S0 until one typed
ExecutionShape decision materializes either Fused or
Split(arith.mulf, arith.addf) under the exact floating environment and
fast-math contract.
A parent containing an unresolved, exactly representable
llvm.intr.fmuladd emits the canonical pair of complete Structured children:
One decision applies uniformly to every unresolved fmuladd in the selected
Spatial ownership of that complete parent. It never rewrites residual
InstructionCore operations or operations owned by nested callables.
That decision is candidate lineage and may be evaluated as a performance choice; target code generation cannot choose it implicitly. The Ownership generator selects the Spatial region but does not own this decision.
candidate.pg// Inputs for --loom-materialize-fmuladd: S0 modules whose callable regions own // unresolved `llvm.intr.fmuladd` operations, plus parents with no unresolved // choice, unrepresentable intrinsics, and intrinsics owned by nested callables. start: {new NFUNC = random.randint(0, 3); new FID = 0} 'module {\n' funcs '}\n'; funcs: (FID < NFUNC) one_func {FID += 1} funcs | (FID == NFUNC) ''; one_func: {new KIND = random.choice(['plain', 'plain', 'plain', 'blocked', 'nested', 'resolved'])} func_form; func_form: (KIND == 'plain') plain_func | (KIND == 'blocked') blocked_func | (KIND == 'nested') nested_func | (KIND == 'resolved') resolved_func; // A complete parent owning one or two unresolved, exactly representable // `llvm.intr.fmuladd` operations in the default floating environment. plain_func: {new TY = random.choice(['f32', 'f64', 'f16', 'vector<4xf32>']); new NFMA = random.randint(1, 2); new K = 0} 'llvm.func @plain_' [str(FID)] '(%x: ' [TY] ', %y: ' [TY] ', %z: ' [TY] ') -> ' [TY] ' {\n' residual_op fma_chain ' llvm.return %x : ' [TY] '\n' '}\n\n'; fma_chain: (K < NFMA) fma_op {K += 1} fma_chain | (K == NFMA) ''; fma_op: ' %r' [str(FID)] '_' [str(K)] ' = llvm.intr.fmuladd(%x, %y, %z) ' fastmath_attr ': (' [TY] ', ' [TY] ', ' [TY] ') -> ' [TY] ' loc("fmuladd_' [str(FID)] '_' [str(K)] '")\n'; // The imported fast-math contract of the source intrinsic. fastmath_attr: {new FM = random.choice([0, 1, 2, 3])} fastmath_body; fastmath_body: (FM == 0) '' | (FM == 1) '{fastmathFlags = #llvm.fastmath<nnan>} ' | (FM == 2) '{fastmathFlags = #llvm.fastmath<nnan, contract>} ' | (FM == 3) '{fastmathFlags = #llvm.fastmath<fast>} '; // Residual computation the ExecutionShape decision must leave alone. residual_op: {new RES = random.choice([0, 1])} residual_body; residual_body: (RES == 0) '' | (RES == 1) ' %m' [str(FID)] ' = llvm.fmul %x, %y : ' [TY] '\n'; // A callable stating a floating-point policy no standard operation restates: // its intrinsic is not exactly representable and stays explicit. blocked_func: {new TY = random.choice(['f32', 'f64']); new POLICY = random.choice([0, 1, 2])} 'llvm.func @blocked_' [str(FID)] '(%x: ' [TY] ', %y: ' [TY] ', %z: ' [TY] ') -> ' [TY] ' ' policy_attrs '{\n' ' %b' [str(FID)] ' = llvm.intr.fmuladd(%x, %y, %z) : (' [TY] ', ' [TY] ', ' [TY] ') -> ' [TY] ' loc("fmuladd_blocked_' [str(FID)] '")\n' ' llvm.return %x : ' [TY] '\n' '}\n\n'; policy_attrs: (POLICY == 0) 'attributes {reciprocal_estimates = "all"} ' | (POLICY == 1) 'attributes {passthrough = ["strictfp"]} ' | (POLICY == 2) 'attributes {no_signed_zeros_fp_math = true} '; // A native func.func owning a nested imported llvm.func: the intrinsic belongs // to the nested callable, which owns its own body. nested_func: {new TY = random.choice(['f32', 'f64'])} 'func.func @native_' [str(FID)] '(%a: ' [TY] ') -> ' [TY] ' {\n' ' builtin.module {\n' ' llvm.func @inner_' [str(FID)] '(%x: ' [TY] ', %y: ' [TY] ', %z: ' [TY] ') -> ' [TY] ' {\n' ' %n' [str(FID)] ' = llvm.intr.fmuladd(%x, %y, %z) {fastmathFlags = #llvm.fastmath<nnan>} : (' [TY] ', ' [TY] ', ' [TY] ') -> ' [TY] ' loc("fmuladd_nested_' [str(FID)] '")\n' ' llvm.return %x : ' [TY] '\n' ' }\n' ' }\n' ' return %a : ' [TY] '\n' '}\n\n'; // A parent with no unresolved selected-Spatial execution-shape choice. resolved_func: {new TY = random.choice(['f32', 'f64'])} 'llvm.func @resolved_' [str(FID)] '(%x: ' [TY] ', %y: ' [TY] ', %z: ' [TY] ') -> ' [TY] ' {\n' ' %p' [str(FID)] ' = math.fma %x, %y, %z : ' [TY] '\n' ' %q' [str(FID)] ' = arith.mulf %x, %y : ' [TY] '\n' ' %s' [str(FID)] ' = arith.addf %q' [str(FID)] ', %z : ' [TY] '\n' ' llvm.return %x : ' [TY] '\n' '}\n\n';
Each child preserves the exact floating type, fast-math contract, source location, Ownership lineage, and source-provenance projection. It is verified and finalized through the sole Structured Program finalizer before publication to the output set.
candidate.spctpostcondition fmuladd_children_preserve_source_type_and_contract { language v0; vocabulary mlir = mlir.generic@1; metadata { project = "PolyArch/loom"; revision = "48615bc5925ef4b9db8b4550b5d4322933cf4b7b"; source = "docs/spec-compiler-part-2-scf.md:L1036-L1039"; } // Two dialect spellings of one fast-math contract: the imported // `#llvm.fastmath<...>` value of the source intrinsic and the // `#arith.fastmath<...>` value a standard floating operation states. // This is a spelling correspondence only; it neither adds nor removes a // flag. definition fastmath_spelling(): Relation<String, String> = set { ("#llvm.fastmath<none>", "#arith.fastmath<none>"), ("#llvm.fastmath<nnan>", "#arith.fastmath<nnan>"), ("#llvm.fastmath<fast>", "#arith.fastmath<fast>"), ("#llvm.fastmath<nnan, contract>", "#arith.fastmath<nnan,contract>"), ("#llvm.fastmath<nnan,contract>", "#arith.fastmath<nnan,contract>"), ("#llvm.fastmath<nnan, contract>", "#arith.fastmath<nnan, contract>"), ("#llvm.fastmath<nnan,contract>", "#arith.fastmath<nnan, contract>") }; // The callables of an S0 program: an imported `llvm.func` and a native // `func.func`. definition callables(p: mlir::Program): Seq<mlir::Operation> = seq { op | op in p.operations where op.name == "llvm.func" or op.name == "func.func" }; // The execution-shape slots the callable `f` owns, in program order: an // unresolved `llvm.intr.fmuladd` or the `math.fma` child materialized in its // place. Operations owned by a nested callable belong to that callable. definition owned_shape_slots(p: mlir::Program, f: mlir::Operation): Seq<mlir::Operation> = seq { op | op in p.operations where (op.name == "llvm.intr.fmuladd" or op.name == "math.fma") and mlir::contains(f, op) and (none g in callables(p) where g != f and mlir::contains(f, g) and mlir::contains(g, op)) }; constraints { forall f in callables(output) { // Ownership lineage: each child stands in the same callable, at the same // slot, as the `llvm.intr.fmuladd` it materializes. assert child_preserves_exact_result_type: exists s in callables(input) where s.attributes["sym_name"].string == f.attributes["sym_name"].string and (forall slot in zip_exact(owned_shape_slots(output, f), owned_shape_slots(input, s)) where slot.left.name != "math.fma" or slot.left.results[0].type == slot.right.results[0].type); assert child_preserves_exact_operand_types: exists s in callables(input) where s.attributes["sym_name"].string == f.attributes["sym_name"].string and (forall slot in zip_exact(owned_shape_slots(output, f), owned_shape_slots(input, s)) where slot.left.name != "math.fma" or (forall pair in zip_exact(slot.left.operands, slot.right.operands) where pair.left.type == pair.right.type)); assert child_preserves_fastmath_contract: exists s in callables(input) where s.attributes["sym_name"].string == f.attributes["sym_name"].string and (forall slot in zip_exact(owned_shape_slots(output, f), owned_shape_slots(input, s)) where slot.left.name != "math.fma" or (slot.right.name == "llvm.intr.fmuladd" and (slot.right.attributes["fastmathFlags"].canonical_text, slot.left.attributes["fastmath"].canonical_text) in fastmath_spelling()) or (slot.right.name == "math.fma" and slot.left.attributes["fastmath"].canonical_text == slot.right.attributes["fastmath"].canonical_text)); } } }
module { llvm.func @blocked_0(%x: f32, %y: f32, %z: f32) -> f32 attributes {no_signed_zeros_fp_math = true} { %b0 = llvm.intr.fmuladd(%x, %y, %z) : (f32, f32, f32) -> f32 loc("fmuladd_blocked_0") llvm.return %x : f32 } }
20260911-043029started2026-09-11T04:30:29Zsubjectloom-raise-optsubject revision48615bc5925erun results
output condition verdicts
raw trace evidence
module { llvm.func @blocked_0(%x: f64, %y: f64, %z: f64) -> f64 attributes {passthrough = ["strictfp"]} { %b0 = llvm.intr.fmuladd(%x, %y, %z) : (f64, f64, f64) -> f64 loc("fmuladd_blocked_0") llvm.return %x : f64 } llvm.func @plain_1(%x: f16, %y: f16, %z: f16) -> f16 { %r1_0 = llvm.intr.fmuladd(%x, %y, %z) {fastmathFlags = #llvm.fastmath<fast>} : (f16, f16, f16) -> f16 loc("fmuladd_1_0") llvm.return %x : f16 } llvm.func @blocked_2(%x: f32, %y: f32, %z: f32) -> f32 attributes {reciprocal_estimates = "all"} { %b2 = llvm.intr.fmuladd(%x, %y, %z) : (f32, f32, f32) -> f32 loc("fmuladd_blocked_2") llvm.return %x : f32 } }
"builtin.module"() ({ "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<f64 (f64, f64, f64)>, linkage = #llvm.linkage<external>, passthrough = ["strictfp"], sym_name = "blocked_0", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({ ^bb0(%arg6: f64, %arg7: f64, %arg8: f64): %2 = "llvm.intr.fmuladd"(%arg6, %arg7, %arg8) <{fastmathFlags = #llvm.fastmath<none>}> : (f64, f64, f64) -> f64 "llvm.return"(%arg6) : (f64) -> () }) : () -> () "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<f16 (f16, f16, f16)>, linkage = #llvm.linkage<external>, sym_name = "plain_1", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({ ^bb0(%arg3: f16, %arg4: f16, %arg5: f16): %1 = "math.fma"(%arg3, %arg4, %arg5) <{fastmath = #arith.fastmath<fast>}> : (f16, f16, f16) -> f16 "llvm.return"(%arg3) : (f16) -> () }) : () -> () "llvm.func"() <{CConv = #llvm.cconv<ccc>, function_type = !llvm.func<f32 (f32, f32, f32)>, linkage = #llvm.linkage<external>, reciprocal_estimates = "all", sym_name = "blocked_2", unnamed_addr = 0 : i64, visibility_ = 0 : i64}> ({ ^bb0(%arg0: f32, %arg1: f32, %arg2: f32): %0 = "llvm.intr.fmuladd"(%arg0, %arg1, %arg2) <{fastmathFlags = #llvm.fastmath<none>}> : (f32, f32, f32) -> f32 "llvm.return"(%arg0) : (f32) -> () }) : () -> () }) : () -> ()
partial source coverage: Approved to run and display existing artifacts; accuracy and completeness are measured separately.
authoring-context.json{"entries":[{"file_sha256":"bfc1e646e91fe0ba6d7d16e43994100b05c3b8ff79c2e07288e8955c43d9d79d","kind":"documentation_input","lines":"1018-1034","path":"docs/spec-compiler-part-2-scf.md","roles":["input_construction","input_well_formedness","applicability"],"text":"The current Structured ExecutionShape generator consumes a finite set of exact\nStructured Program references. An empty input set produces an empty output\nset. A parent with no unresolved selected-Spatial execution-shape choice passes\nthrough unchanged. A parent containing an unresolved, exactly representable\n`llvm.intr.fmuladd` emits the canonical pair of complete Structured children:\n\n```text\nFused -> math.fma\nSplit -> arith.mulf followed by arith.addf\n```\n\nOne decision applies uniformly to every unresolved `fmuladd` in the selected\nSpatial ownership of that complete parent. It never rewrites residual\nInstructionCore operations or operations owned by nested callables. This is a\ntwo-element semantic policy domain, not one independent Boolean dimension per\noperation. Distinct per-operation combinations are not part of the current\ncontract.","why":"Normative input conditions of the Structured ExecutionShape generator: a finite set of Structured Program references, an empty input set, a parent with no unresolved choice, a parent owning an unresolved exactly representable llvm.intr.fmuladd, the two-element Fused/Split policy domain applied uniformly to every unresolved fmuladd of one parent, and the exclusion of residual InstructionCore operations and operations owned by nested callables. Determines the sampled module shapes (empty module, resolved parent, plain parent with one or two fmuladds, nested callable) and the per-callable slot scoping of the postcondition."},{"file_sha256":"bfc1e646e91fe0ba6d7d16e43994100b05c3b8ff79c2e07288e8955c43d9d79d","kind":"documentation_input","lines":"1036-1044","path":"docs/spec-compiler-part-2-scf.md","roles":["context"],"text":"Each child preserves the exact floating type, fast-math contract, source\nlocation, Ownership lineage, and source-provenance projection. It is verified\nand finalized through the sole Structured Program finalizer before publication\nto the output set. Schedule and MemoryCommunication may then form further\ncomplete Structured children. The terminal SpecialMathAccuracy generator is\nthe selected-Spatial semantic-closure gate that first lowers the final complete\ncandidate to D0 and checks exact concrete Fabric admission. No unresolved\nparent, mixed Fused/Split child, hidden backend default, or\ntarget-code-generation choice may cross the ExecutionShape boundary.","why":"Governing context of the sampled obligation; fixes the terminology (child, Fused/Split, ExecutionShape boundary) in which the selected output condition about preserving the exact floating type, fast-math contract, source location and Ownership lineage is read. Used for terminology only; no extra constraint is derived from it."},{"file_sha256":"bfc1e646e91fe0ba6d7d16e43994100b05c3b8ff79c2e07288e8955c43d9d79d","kind":"documentation_input","lines":"177-186","path":"docs/spec-compiler-part-2-scf.md","roles":["input_construction","applicability"],"text":"FMA normalization is semantic rather than name based. An exact fused LLVM FMA\nbecomes `math.fma`. `llvm.intr.fmuladd` remains unchanged in S0 until one typed\n`ExecutionShape` decision materializes either `Fused` or\n`Split(arith.mulf, arith.addf)` under the exact floating environment and\nfast-math contract. That decision is candidate lineage and may be evaluated as\na performance choice; target code generation cannot choose it implicitly. The\nOwnership generator selects the Spatial region but does not own this decision.\nThe ExecutionShape generator resolves it before Schedule or Dataflow lowering\nmay consume the candidate. After materialization, no `fmuladd` operation may\nremain in a finalizable Sn or be registered as a Canonical Dataflow actor.","why":"States that llvm.intr.fmuladd remains unchanged in S0 until one typed ExecutionShape decision materializes Fused or Split(arith.mulf, arith.addf) under the exact floating environment and fast-math contract, and that the ExecutionShape generator owns that decision. Establishes that the subject stage is loom-materialize-fmuladd with an explicit shape and that the sampled inputs are S0 callables still carrying the intrinsic."},{"file_sha256":"bfc1e646e91fe0ba6d7d16e43994100b05c3b8ff79c2e07288e8955c43d9d79d","kind":"documentation_input","lines":"166-175","path":"docs/spec-compiler-part-2-scf.md","roles":["input_well_formedness"],"text":"The LLVM dialect `passthrough` function attribute is an importer-owned lossless\ncontainer, not a floating-point-environment authority. Mechanical raising uses\none closed classifier owned by the exact-spelling projection. Typed LLVM\nfloating environment attributes, `strictfp`, incompatible exception policy,\nand unknown string attributes block standard spelling. LLVM enum function\nattributes and explicitly classified code-generation-only strings do not.\nClang's default `no-trapping-math=true` is compatible with the ordinary\nnon-constrained floating operation spelling; any other value fails closed.\nOwnership materialization and Dataflow lowering never reinterpret this\nclassification.","why":"The closed classifier for the LLVM passthrough attribute and typed floating-environment attributes: strictfp and unknown string attributes block standard spelling. Justifies the sampled non-representable callables (passthrough strictfp, reciprocal_estimates, no_signed_zeros_fp_math) whose intrinsics must stay explicit, so the postcondition must tolerate unmaterialized slots."},{"file_sha256":"2b0705aba1c16c80e5338d443989a9cdcbac47a60c140bff5b886c617a9f9a8f","kind":"implementation","lines":"1-33,135-165","path":"lib/Frontend/Raising/MaterializeFMulAddPass.cpp","roles":["applicability","input_construction"],"text":"// Materialize the execution shape of `llvm.intr.fmuladd`.\n//\n// `llvm.intr.fmuladd` is not a computation, it is an unmade choice: the target\n// may contract it into one fused multiply-add with a single rounding, or\n// evaluate an ordinary multiply followed by an ordinary add with two. The two\n// results differ, so nothing downstream may pick one implicitly and no shape\n// can be inferred from the intrinsic spelling. Mechanical raising therefore\n// leaves the intrinsic alone, and this pass materializes exactly the one shape\n// its caller selected:\n//\n// Fused -> math.fma\n// Split -> arith.mulf then arith.addf\n//\n// The two shapes differ in what they permit, not only in what they spell.\n// Fused carries the complete source fast-math contract onto the one fused\n// operation. Split consumes the source's `contract` permission: the multiply\n// and the add each round on their own, and neither may be contracted back\n// into a single rounding by a later pass or by target code generation.\n//\n// The selected shape is the entire decision this pass makes, so it is a\n// required typed option rather than a defaulted one, in the same shape as the\n// typed Dataflow rewrite catalog.\n//\n// A materialization is legal only when the target operations restate the whole\n// source computation: exact numeric types, the operation's fast-math contract,\n// the default floating-point environment the intrinsic is evaluated in, and\n// the enclosing callable's floating-point environment. `math.fma` and the\n// `arith` floating operations state no environment of their own, so a callable\n// stating one that they cannot restate cannot receive either shape.\n//\n// Representability is intrinsic-local. An intrinsic whose complete semantics\n// the selected standard form cannot restate remains explicit; it does not\n// prevent representable siblings from receiving the selected shape.\n ::llvm::StringRef getArgument() const final {\n return \"loom-materialize-fmuladd\";\n }\n ::llvm::StringRef getDescription() const final {\n return \"Materialize one selected execution shape for each exactly \"\n \"representable llvm.intr.fmuladd in callable regions.\";\n }\n\n void getDependentDialects(::mlir::DialectRegistry ®istry) const final {\n registry.insert<::mlir::arith::ArithDialect, ::mlir::LLVM::LLVMDialect,\n ::mlir::math::MathDialect>();\n }\n\n // The shape is the decision, so there is no default: silently choosing one\n // would materialize a form the caller never selected.\n ::mlir::Pass::Option<FMulAddExecutionShape> shape{\n *this, \"shape\",\n ::llvm::cl::desc(\"execution shape to materialize for llvm.intr.fmuladd\"),\n ::llvm::cl::values(\n clEnumValN(FMulAddExecutionShape::Fused, \"fused\",\n \"one math.fma with a single rounding\"),\n clEnumValN(FMulAddExecutionShape::Split, \"split\",\n \"an arith.mulf followed by an arith.addf\"))};\n\n void runOnOperation() final {\n if (!shape.hasValue()) {\n getOperation()->emitError(\n \"loom-materialize-fmuladd requires an explicit 'shape' option\");\n return signalPassFailure();\n }","why":"The stage under test: pass argument string loom-materialize-fmuladd, the required typed 'shape' option with no default (fused -> math.fma, split -> arith.mulf then arith.addf), the fail-closed error when no shape is supplied, and the statement that a materialization keeps the source location and the exact operand and result types. Fixes the subject-command flags and confirms the output population the obligation constrains."},{"file_sha256":"2b0705aba1c16c80e5338d443989a9cdcbac47a60c140bff5b886c617a9f9a8f","kind":"implementation","lines":"59-98","path":"lib/Frontend/Raising/MaterializeFMulAddPass.cpp","roles":["context"],"text":"void materializeOne(::mlir::LLVM::FMulAddOp op, FMulAddExecutionShape shape,\n ::mlir::IRRewriter &rewriter) {\n rewriter.setInsertionPoint(op);\n ::mlir::Location loc = op.getLoc();\n ::mlir::Type type = op.getRes().getType();\n ::mlir::arith::FastMathFlags fastmath =\n loom::raising::exactFastMathFlags(op.getFastmathFlags());\n // No materialized operation states a rounding mode. An arith or math\n // operation that states one is a constrained operation: standard lowering\n // turns it into `llvm.intr.experimental.constrained.*` under an explicit\n // rounding and exception mode, and drops the fast-math flags on the way.\n // llvm.intr.fmuladd is an ordinary non-constrained intrinsic in the default\n // environment, so both shapes leave the mode absent and lower back to\n // ordinary LLVM floating operations.\n if (shape == FMulAddExecutionShape::Fused) {\n // Fusing is what the shape decided, so the complete source contract,\n // `contract` included, carries onto the one fused operation.\n rewriter.replaceOpWithNewOp<::mlir::math::FmaOp>(\n op, type, op.getA(), op.getB(), op.getC(), fastmath);\n return;\n }\n\n // `contract` is the source's permission to fuse this multiply and add into\n // one rounding. Selecting Split is the decision that declines it, so the\n // permission is consumed here rather than restated on the result: a\n // multiply and an add that still carried it would let any later contraction\n // -- upstream's own arith-to-math.fma uplift, or a backend -- re-fuse them\n // and silently undo the shape. Every other source flag is a property of the\n // computation, not of fusion, and carries onto both operations unchanged.\n ::mlir::arith::FastMathFlags split = ::mlir::arith::bitEnumClear(\n fastmath, ::mlir::arith::FastMathFlags::contract);\n\n auto product =\n ::mlir::arith::MulFOp::create(rewriter, loc, type, op.getA(), op.getB());\n product.setFastmath(split);\n auto sum = ::mlir::arith::AddFOp::create(rewriter, loc, type,\n product.getResult(), op.getC());\n sum.setFastmath(split);\n rewriter.replaceOp(op, sum);\n}","why":"Acceptance behaviour of one materialization: the Fused child carries the complete source fast-math contract, while the Split children clear the contract permission. Evidence for the stage-attribution note in AUTHORING-RESULT.md and for selecting shape=fused, whose child is the one the documented preservation wording holds of literally."},{"file_sha256":"fc8794a0235430f2ab7b87b0fb63e4991acfa052ab630501b484fce956154a56","kind":"verifier","lines":"35-52,123-161","path":"lib/Frontend/Raising/ExactStandardSpelling.h","roles":["input_well_formedness","applicability"],"text":"inline bool isExactNumericType(::mlir::Type type) {\n if (auto vectorType = ::mlir::dyn_cast<::mlir::VectorType>(type)) {\n if (vectorType.isScalable())\n return false;\n type = vectorType.getElementType();\n }\n if (auto integerType = ::mlir::dyn_cast<::mlir::IntegerType>(type))\n return integerType.isSignless() && integerType.getWidth() > 0;\n return ::mlir::isa<::mlir::IndexType, ::mlir::FloatType>(type);\n}\n\ninline bool allExactNumericTypes(::mlir::ValueRange values) {\n for (::mlir::Value value : values) {\n if (!isExactNumericType(value.getType()))\n return false;\n }\n return true;\n}\ninline bool statesFloatingPolicy(::mlir::LLVM::LLVMFuncOp funcOp) {\n if (auto env = funcOp.getDenormalFpenvAttr())\n if (!statesDefaultDenormalEnvironment(env))\n return true;\n if (auto noSignedZeros = funcOp.getNoSignedZerosFpMathAttr())\n if (noSignedZeros.getValue())\n return true;\n if (auto contraction = funcOp.getFpContractAttr())\n if (contraction.getValue() != \"off\")\n return true;\n if (funcOp.getReciprocalEstimatesAttr())\n return true;\n if (auto passthrough = funcOp.getPassthroughAttr())\n for (::mlir::Attribute entry : passthrough)\n if (passthroughEntryStatesFloatingPolicy(entry))\n return true;\n return false;\n}\n\n// True when the enclosing callable states a floating-point environment the\n// standard operation cannot restate.\ninline bool enclosingFloatingPolicyBlocksRewrite(::mlir::Operation *op) {\n auto funcOp = ::mlir::dyn_cast_or_null<::mlir::LLVM::LLVMFuncOp>(\n getNearestCallableOp(op));\n return funcOp && statesFloatingPolicy(funcOp);\n}\n\n// True when every operand and the single result of `op` have an exact standard\n// counterpart and, for a computation that reads or produces a floating value,\n// the enclosing callable states no environment the standard operation cannot\n// restate. An integer computation is independent of that environment and is\n// never blocked by it.\ninline bool restatesExactly(::mlir::Operation *op, bool floating) {\n if (!allExactNumericTypes(op->getOperands()))\n return false;\n if (!isExactNumericType(op->getResult(0).getType()))\n return false;\n return !floating || !enclosingFloatingPolicyBlocksRewrite(op);\n}","why":"Acceptance implementation of 'exactly representable': exact numeric types (signless integers, index, floats, fixed-shape vectors) and an enclosing llvm.func that states no floating policy (denormal env, no_signed_zeros_fp_math, fp_contract, reciprocal_estimates, passthrough). Determines which sampled types (f16/f32/f64/vector<4xf32>) are materialized and which sampled callables keep their intrinsic."},{"file_sha256":"fc8794a0235430f2ab7b87b0fb63e4991acfa052ab630501b484fce956154a56","kind":"language_definition","lines":"163-189","path":"lib/Frontend/Raising/ExactStandardSpelling.h","roles":["context"],"text":"// arith counterpart of LLVM's fast-math flags. Both enums name the same\n// seven facts but assign them different bit positions, so each flag is\n// mapped by name instead of being reinterpreted.\ninline ::mlir::arith::FastMathFlags\nexactFastMathFlags(::mlir::LLVM::FastmathFlags flags) {\n const std::pair<::mlir::LLVM::FastmathFlags, ::mlir::arith::FastMathFlags>\n equivalents[] = {\n {::mlir::LLVM::FastmathFlags::nnan,\n ::mlir::arith::FastMathFlags::nnan},\n {::mlir::LLVM::FastmathFlags::ninf,\n ::mlir::arith::FastMathFlags::ninf},\n {::mlir::LLVM::FastmathFlags::nsz, ::mlir::arith::FastMathFlags::nsz},\n {::mlir::LLVM::FastmathFlags::arcp,\n ::mlir::arith::FastMathFlags::arcp},\n {::mlir::LLVM::FastmathFlags::contract,\n ::mlir::arith::FastMathFlags::contract},\n {::mlir::LLVM::FastmathFlags::afn, ::mlir::arith::FastMathFlags::afn},\n {::mlir::LLVM::FastmathFlags::reassoc,\n ::mlir::arith::FastMathFlags::reassoc}};\n\n ::mlir::arith::FastMathFlags result{};\n for (auto [llvmFlag, arithFlag] : equivalents) {\n if (::mlir::LLVM::bitEnumContainsAll(flags, llvmFlag))\n result = result | arithFlag;\n }\n return result;\n}","why":"The name-by-name equivalence between LLVM's FastmathFlags and arith's FastMathFlags (nnan, ninf, nsz, arcp, contract, afn, reassoc are the same seven facts in two enums). Fixes the two dialect spellings of one fast-math contract that the postcondition's spelling correspondence table relates; it adds no behavioural requirement."},{"file_sha256":"d1315fabeb736f07fdd93eca093e20d05a201967b181a40cb02f37048ba2c79a","kind":"implementation","lines":"29-31,55-95","path":"lib/Frontend/Raising/CallableRegions.h","roles":["input_construction","input_well_formedness"],"text":"inline bool isCallableOp(::mlir::Operation *op) {\n return ::mlir::isa<::mlir::LLVM::LLVMFuncOp, ::mlir::func::FuncOp>(op);\n}\ninline ::mlir::LogicalResult forEachCallableRegion(\n ::mlir::Operation *root,\n ::llvm::function_ref<::mlir::LogicalResult(::mlir::Region &)> transform) {\n ::mlir::WalkResult walked =\n root->walk<::mlir::WalkOrder::PostOrder>([&](::mlir::Operation *op) {\n if (!isCallableOp(op))\n return ::mlir::WalkResult::advance();\n for (::mlir::Region ®ion : op->getRegions()) {\n if (region.empty())\n continue;\n if (failed(transform(region)))\n return ::mlir::WalkResult::interrupt();\n }\n return ::mlir::WalkResult::advance();\n });\n return walked.wasInterrupted() ? ::mlir::failure() : ::mlir::success();\n}\n\n// Offer `visit` to every operation `region` owns, recursing into nested\n// regions that belong to the same callable -- scf.for, scf.if, a graph\n// region -- but stopping at any nested callable, whose own body this region\n// must not claim to own.\n//\n// This is the operation-level half of callable ownership: a callable processes\n// exactly the operations its nearest enclosing callable owns, and a nested\n// callable's body is left to that callable's own region-level walk. Crossing\n// into a nested callable here would visit its operations twice -- once\n// descended into from the enclosing region and once from the callable's own\n// walk -- so the nested callable is pruned instead. Pruning happens in\n// pre-order: in a post-order walk a callable's body is visited before the\n// callable itself, so the skip would arrive one descent too late.\ninline ::mlir::WalkResult forEachOwnedOperation(\n ::mlir::Region ®ion,\n ::llvm::function_ref<::mlir::WalkResult(::mlir::Operation *)> visit) {\n return region.walk<::mlir::WalkOrder::PreOrder>(\n [&](::mlir::Operation *op) -> ::mlir::WalkResult {\n if (isCallableOp(op))\n return ::mlir::WalkResult::skip();\n return visit(op);\n });\n}","why":"Callable kinds of an S0 program (llvm.func, func.func) and the ownership walk that prunes nested callables, so each operation is owned by exactly one callable. Fixes the two callable spellings the grammar emits and the innermost-callable ownership scoping used by the postcondition's owned_shape_slots definition."},{"file_sha256":"6f55dfe3ca2a9edcd0d955b965b5011a8010478cf28db89485df1fdfb2750c9c","kind":"test","lines":"1-16","path":"test/raise/fmuladd-materialization.mlir","roles":["applicability"],"text":"// RUN: split-file %s %t\n// RUN: not loom-raise-opt --loom-materialize-fmuladd %t/choice.mlir 2>&1 | FileCheck %s --check-prefix=UNSELECTED\n// RUN: loom-raise-opt --loom-materialize-fmuladd=shape=fused %t/choice.mlir | FileCheck %s --check-prefix=FUSED\n// RUN: loom-raise-opt --loom-materialize-fmuladd=shape=split %t/choice.mlir | FileCheck %s --check-prefix=SPLIT\n// RUN: loom-raise-opt --loom-materialize-fmuladd=shape=fused %t/choice.mlir | mlir-opt --convert-math-to-llvm --convert-arith-to-llvm | FileCheck %s --check-prefix=FUSED-LLVM --implicit-check-not=constrained\n// RUN: loom-raise-opt --loom-materialize-fmuladd=shape=split %t/choice.mlir | mlir-opt --convert-math-to-llvm --convert-arith-to-llvm | FileCheck %s --check-prefix=SPLIT-LLVM --implicit-check-not=constrained\n// RUN: loom-raise-opt --loom-materialize-fmuladd=shape=split %t/choice.mlir | mlir-opt --math-uplift-to-fma | FileCheck %s --check-prefix=SPLIT-KEPT --implicit-check-not=math.fma\n// RUN: loom-raise-opt --loom-materialize-fmuladd=shape=fused %t/unrepresentable.mlir | FileCheck %s --check-prefix=SCOPED\n// RUN: loom-raise-opt --loom-materialize-fmuladd=shape=fused %t/nested.mlir | FileCheck %s --check-prefix=NESTED --implicit-check-not=llvm.intr.fmuladd\n// RUN: loom-raise-opt --loom-lower-for-to-graph --mlir-disable-threading %t/selected-fused.mlir | FileCheck %s --check-prefix=SELECTED-FUSED --implicit-check-not=loom.spatial_region\n\n// `llvm.intr.fmuladd` states a choice, not a computation: the target may fuse\n// it into one rounding or evaluate a separate multiply and add. Materializing\n// that choice is a typed decision with no default, so the shape is required\n// and is never inferred from the intrinsic spelling.\n// UNSELECTED: loom-materialize-fmuladd requires an explicit 'shape' option","why":"Non-normative evidence for the exact invocation of this stage: '--loom-materialize-fmuladd=shape=fused' / '=shape=split' and the diagnostic produced when the shape option is omitted. Basis for the revised subject-command args and their rationale."},{"file_sha256":"6f55dfe3ca2a9edcd0d955b965b5011a8010478cf28db89485df1fdfb2750c9c","kind":"example","lines":"91-126","path":"test/raise/fmuladd-materialization.mlir","roles":["input_construction"],"text":"//--- choice.mlir\nllvm.func @chosen(%x: f32, %y: f32, %z: f32) -> f32 {\n %r = llvm.intr.fmuladd(%x, %y, %z)\n {fastmathFlags = #llvm.fastmath<nnan, contract>} : (f32, f32, f32) -> f32\n llvm.return %r : f32\n}\n\nllvm.func @vector_chosen(%x: vector<4xf32>, %y: vector<4xf32>,\n %z: vector<4xf32>) -> vector<4xf32> {\n %r = llvm.intr.fmuladd(%x, %y, %z)\n : (vector<4xf32>, vector<4xf32>, vector<4xf32>) -> vector<4xf32>\n llvm.return %r : vector<4xf32>\n}\n\n//--- unrepresentable.mlir\nllvm.func @representable(%x: f32, %y: f32, %z: f32) -> f32 {\n %r = llvm.intr.fmuladd(%x, %y, %z) : (f32, f32, f32) -> f32\n llvm.return %r : f32\n}\n\nllvm.func @estimated(%x: f32, %y: f32, %z: f32) -> f32\n attributes {reciprocal_estimates = \"all\"} {\n %r = llvm.intr.fmuladd(%x, %y, %z) : (f32, f32, f32) -> f32\n llvm.return %r : f32\n}\n\n//--- nested.mlir\nfunc.func @native_owner(%a: f32, %b: f32, %c: f32) -> f32 {\n builtin.module {\n llvm.func @inner(%x: f32, %y: f32, %z: f32) -> f32 {\n %r = llvm.intr.fmuladd(%x, %y, %z) : (f32, f32, f32) -> f32\n llvm.return %r : f32\n }\n }\n return %a : f32\n}","why":"Accepted input spellings reused as the skeleton of the grammar: llvm.func with scalar and vector fmuladd and fastmathFlags = #llvm.fastmath<...>, a callable whose reciprocal_estimates policy blocks materialization, and a func.func owning a nested builtin.module with an llvm.func. Names, types and cardinalities are treated as one accepted spelling only."},{"file_sha256":"6f55dfe3ca2a9edcd0d955b965b5011a8010478cf28db89485df1fdfb2750c9c","kind":"test","lines":"18-40","path":"test/raise/fmuladd-materialization.mlir","roles":["context"],"text":"// Fusing is what the fused shape decided, so the exact operand and result\n// types and the complete imported fast-math contract -- `contract` included --\n// all carry onto the one `math.fma`.\n// FUSED-LABEL: llvm.func @chosen\n// FUSED: math.fma %arg0, %arg1, %arg2 fastmath<nnan,contract> : f32\n// FUSED-NOT: llvm.intr.fmuladd\n// FUSED-LABEL: llvm.func @vector_chosen\n// FUSED: math.fma %arg0, %arg1, %arg2 : vector<4xf32>\n// FUSED-NOT: llvm.intr.fmuladd\n\n// The split shape is an ordinary multiply then an ordinary add, each rounding\n// on its own. `contract` is the source's permission to fuse them back into one\n// rounding, so selecting Split consumes it: neither operation restates it.\n// Every other imported flag describes the computation rather than the fusion\n// and carries onto both operations unchanged.\n// SPLIT-LABEL: llvm.func @chosen\n// SPLIT: %[[PROD:.*]] = arith.mulf %arg0, %arg1 fastmath<nnan> : f32\n// SPLIT: arith.addf %[[PROD]], %arg2 fastmath<nnan> : f32\n// SPLIT-NOT: llvm.intr.fmuladd\n// SPLIT-LABEL: llvm.func @vector_chosen\n// SPLIT: %[[VPROD:.*]] = arith.mulf %arg0, %arg1 : vector<4xf32>\n// SPLIT: arith.addf %[[VPROD]], %arg2 : vector<4xf32>\n// SPLIT-NOT: llvm.intr.fmuladd","why":"Non-normative evidence of the fast-math spellings on both sides of the rewrite (#llvm.fastmath<nnan, contract> on the intrinsic, fastmath<nnan,contract> on math.fma, contract absent on the split children). Used only to fix the two dialect spellings of one contract that the postcondition's spelling correspondence table relates."}],"primary_bundle_sha256":"33099887f46470c09e8577705091e3d07a426f909222b7bdfbe0610d7ff970ed","project":"PolyArch/loom","revision":"48615bc5925ef4b9db8b4550b5d4322933cf4b7b","schema":"spectriad.authoring-context/v1","selection_sha256":"e54e306ef453403889124a88878b90dde2bb0d1a050089fc65afbe3b1f1d1c37"}
sessions/reverse-generator/session-evidence/result-events.json[
{
"api_error_status": null,
"duration_api_ms": 48597,
"duration_ms": 48649,
"fast_mode_disabled_reason": "sdk_opt_in_required",
"fast_mode_state": "off",
"first_content_frame_ms": 1441,
"is_error": false,
"modelUsage": {
"claude-opus-5": {
"cacheCreationInputTokens": 5091,
"cacheReadInputTokens": 0,
"canonicalModel": "claude-opus-5",
"contextWindow": 1000000,
"costBasis": "list",
"costUSD": 0.14182,
"inputTokens": 2,
"maxOutputTokens": 64000,
"outputTokens": 3636,
"provider": "firstParty",
"thinkingTokens": 735,
"webSearchRequests": 0
}
},
"num_turns": 1,
"permission_denials": [],
"queued_turn_count": 0,
"result": "## Preconditions\n\n1. Every emitted program is a single top-level `module { ... }` whose body consists only of a possibly empty sequence of callable definitions, with no other top-level operations, no symbol-table attributes, and no terminator written for the module itself.\n2. Each callable is either an `llvm.func` (forms named `plain_*`, `blocked_*`, `resolved_*`, and the inner `inner_*`) or a `func.func` (form named `native_*`), never a declaration without a body: every callable emitted carries a full `{ ... }` region.\n3. Every symbol name in a program is unique, because each callable name is suffixed with the position index of the function within the module, and the nested inner callable reuses that same index under a distinct prefix.\n4. Every SSA value name is unique within its enclosing region, achieved by embedding the function index (and, for chained intrinsics, the intrinsic index) in the name.\n5. Every operand is defined before its use: the only intra-body data dependence emitted is `arith.addf %q<n>, %z`, which consumes the result of the immediately preceding `arith.mulf` in the same block.\n6. `llvm.intr.fmuladd` always appears with exactly three operands of one common type and a result of that same type, written in the full functional form `(T, T, T) -> T`.\n7. The three operands of every `llvm.intr.fmuladd` are the block arguments `%x`, `%y`, `%z` of the callable that owns the operation, so the intrinsic never reads a value produced by another operation.\n8. Every callable that owns an `llvm.intr.fmuladd` has a three-argument signature `(%x: T, %y: T, %z: T) -> T` in which the argument types, the result type, and the intrinsic's operand/result type are all the same single type.\n9. Every `llvm.func` body terminates with `llvm.return %x : T` whose operand type equals the declared result type, and the `func.func` body terminates with `return %a : T` likewise matching its declared result type; no other terminators are used.\n10. The results of the emitted `llvm.intr.fmuladd`, `llvm.fmul`, `math.fma`, `arith.mulf`, and `arith.addf` operations are dead \u2014 no emitted return or later operation consumes an intrinsic or residual result except the `arith.mulf` \u2192 `arith.addf` pair.\n11. When a fast-math contract is present, it is written as the discrete attribute `{fastmathFlags = #llvm.fastmath<...>}` attached directly to the `llvm.intr.fmuladd` operation, between the operand list and the `:` type signature.\n12. Function-level attributes, when present, are written as an `attributes { ... }` clause placed after the signature and before the opening brace of the body, and they never appear on the same callable as an operation-level fast-math attribute.\n13. The nested form places its `llvm.intr.fmuladd` inside an `llvm.func` that is itself inside a `builtin.module` region nested in a `func.func` body, so the intrinsic's nearest enclosing callable is the inner `llvm.func` and not the outer `func.func`; the outer `func.func` region contains no floating-point operation of its own.\n14. The nested inner `llvm.func` has its own complete body with its own three block arguments and its own `llvm.return`, independent of the outer function's single argument `%a`.\n15. Location information, when emitted, is a trailing `loc(\"...\")` on the intrinsic operation with a string unique to that operation within the program; operations without a `loc` are left with the default unknown location.\n16. All floating-point types used in a single callable are one uniform type drawn from the scalar types `f32`, `f64`, `f16` or the vector type `vector<4xf32>`; type mixing within one callable never occurs.\n17. The alternative \"resolved\" shape contains no `llvm.intr.fmuladd` at all: it uses only `math.fma`, `arith.mulf`, and `arith.addf` on the block arguments, and thus an emitted program need not contain any intrinsic.\n18. An emitted program may legally contain zero callables, so the empty module is a valid input.\n\n## Sampling conventions\n\n1. The number of top-level callables is chosen uniformly from the integer range 0 through 3 inclusive, so no program has more than three top-level functions.\n2. Functions are emitted in index order starting at 0, with the index recorded in state and incremented once per function; the index is textually reused in every symbol, SSA name, and location string of that function.\n3. Each function independently selects one of exactly four shapes from a six-element menu in which the `plain` shape occurs three times and `blocked`, `nested`, and `resolved` once each, so the plain shape is over-represented but all four remain reachable.\n4. The `plain` shape draws its uniform type from exactly the four choices `f32`, `f64`, `f16`, `vector<4xf32>`; no other element type, bit width, vector shape, or scalable vector is ever emitted.\n5. The `blocked`, `nested`, and `resolved` shapes restrict their type to `f32` or `f64` only, so vector and half-precision types appear exclusively in the plain shape.\n6. A plain function emits between 1 and 2 `llvm.intr.fmuladd` operations, chosen uniformly, generated by a state-counted right recursion that stops exactly when the counter equals the chosen count; three or more intrinsics in one plain function are never emitted.\n7. The result names of the plain chain are `%r<fid>_<k>` with `k` running from 0, and the matching location strings are `\"fmuladd_<fid>_<k>\"`.\n8. Each intrinsic in a plain chain independently draws its fast-math contract from exactly four options: no attribute at all, `<nnan>`, `<nnan, contract>`, or `<fast>`; no other flag names, combinations, or orderings are produced, and two intrinsics in the same function may differ.\n9. A plain function optionally prefixes its intrinsic chain with exactly one residual operation `%m<fid> = llvm.fmul %x, %y : T`, chosen by a binary coin; when omitted nothing is emitted in its place, and never more than one residual operation is produced.\n10. The residual `llvm.fmul` is always emitted before the intrinsic chain and never after or between intrinsics.\n11. The `blocked` shape emits exactly one intrinsic, named `%b<fid>` with location `\"fmuladd_blocked_<fid>\"`, and never carries a fast-math attribute on that intrinsic.\n12. The `blocked` shape's function attribute is drawn from exactly three fixed alternatives \u2014 `reciprocal_estimates = \"all\"`, `passthrough = [\"strictfp\"]`, and `no_signed_zeros_fp_math = true` \u2014 each emitted alone, never combined and never on any other shape.\n13. The `nested` shape is a fixed skeleton with a single `builtin.module` nesting level containing exactly one inner `llvm.func` with exactly one intrinsic `%n<fid>` and location `\"fmuladd_nested_<fid>\"`; the nesting depth, inner function count, and intrinsic count are never varied.\n14. The nested intrinsic's fast-math attribute is fixed to `{fastmathFlags = #llvm.fastmath<nnan>}` and is never absent or varied.\n15. The outer `func.func` of the nested shape always has exactly one argument `%a` of the same type as the inner function's type and returns it unchanged.\n16. The `resolved` shape is a fixed three-operation skeleton \u2014 `%p<fid> = math.fma`, `%q<fid> = arith.mulf`, `%s<fid> = arith.addf` \u2014 always in that order, always on `%x`, `%y`, `%z`, with no attributes and no `loc` on any of them.\n17. Symbol names follow the fixed scheme `@plain_<fid>`, `@blocked_<fid>`, `@native_<fid>`, `@inner_<fid>`, `@resolved_<fid>`, and SSA value prefixes are fixed per shape (`%r`, `%m`, `%b`, `%n`, `%p`, `%q`, `%s`).\n18. Every callable returns its first argument (`%x`, or `%a` for the outer native function) rather than any computed value, a fixed skeleton choice that keeps all computed results dead.\n19. Formatting is fixed: two-space indentation inside `llvm.func` bodies, deeper indentation for the nested module and inner function, one blank line after each top-level callable, and the module's closing brace on its own final line.\n20. Location strings are emitted for intrinsic operations only, never for residual, return, or arithmetic operations, and never in any form other than the string-literal `loc(\"...\")`.",
"result_index": 0,
"session_id": "d4aed091-2a0a-4192-b909-0bd30d0aaff4",
"stop_reason": "end_turn",
"subagent_stats": {
"by_type": {},
"completed": 0,
"failed": 0,
"killed": {
"parent": 0,
"system": 0,
"user": 0
},
"max_depth": 0,
"refused": {
"budget": 0,
"concurrency_limit": 0,
"depth_limit": 0
},
"requested": {
"background": 0,
"foreground": 0,
"unset": 0
},
"spawned": 0,
"spawned_by_subagents": 0,
"started_in_background": 0
},
"subtype": "success",
"terminal_reason": "completed",
"time_to_request_ms": 53,
"total_cost_usd": 0.14182,
"ttft_ms": 12042,
"ttft_stream_ms": 1120,
"type": "result",
"usage": {
"cache_creation": {
"ephemeral_1h_input_tokens": 5091,
"ephemeral_5m_input_tokens": 0
},
"cache_creation_input_tokens": 5091,
"cache_read_input_tokens": 0,
"inference_geo": "not_available",
"input_tokens": 2,
"iterations": [],
"output_tokens": 3636,
"output_tokens_details": {
"thinking_tokens": 735
},
"server_tool_use": {
"web_fetch_requests": 0,
"web_search_requests": 0
},
"service_tier": "standard",
"speed": "standard"
},
"uuid": "d9cdadcd-e052-4904-9a9e-6ec15c1fc4d4"
}
]
sessions/reverse-postcondition/session-evidence/result-events.json[
{
"api_error_status": null,
"duration_api_ms": 17915,
"duration_ms": 17940,
"fast_mode_disabled_reason": "sdk_opt_in_required",
"fast_mode_state": "off",
"first_content_frame_ms": 1555,
"is_error": false,
"modelUsage": {
"claude-opus-5": {
"cacheCreationInputTokens": 6581,
"cacheReadInputTokens": 0,
"canonicalModel": "claude-opus-5",
"contextWindow": 1000000,
"costBasis": "list",
"costUSD": 0.099695,
"inputTokens": 2,
"maxOutputTokens": 64000,
"outputTokens": 1355,
"provider": "firstParty",
"thinkingTokens": 611,
"webSearchRequests": 0
}
},
"num_turns": 1,
"permission_denials": [],
"queued_turn_count": 0,
"result": "This postcondition quantifies universally over every operation in the output program whose name is `llvm.func` or `func.func`, at any nesting depth, and for each one requires the existence of at least one input operation of those same two names whose `sym_name` attribute string is identical. The compared items are each callable's \"shape slots\": the operations named `llvm.intr.fmuladd` or `math.fma` that are structurally contained in the callable but not contained in any other callable that is itself nested inside it, taken in program order; the output slot list and the input slot list are paired by `zip_exact`, so a length mismatch makes the assert fail outright rather than pass vacuously. Each of the three asserts only inspects a pair when the output-side operation is `math.fma`; pairs whose output-side operation is `llvm.intr.fmuladd` are accepted without any further check. For accepted-by-inspection pairs, the first assert demands that the output `math.fma`'s first result type equal the input operation's first result type, and the second demands that their operand lists zip position-by-position with equal types, so differing operand counts fail. The third assert admits exactly two value sources for fast-math text: if the input-side operation is `llvm.intr.fmuladd`, the pair consisting of its `fastmathFlags` canonical text and the output `math.fma`'s `fastmath` canonical text must appear literally in the seven-entry table declared in `fastmath_spelling`, and if the input-side operation is `math.fma`, the two `fastmath` canonical texts must be string-equal; no other spelling, normalization, or flag-set reasoning is accepted. All attribute reads (`sym_name`, `fastmathFlags`, `fastmath`) are unguarded, so an absent attribute on an inspected operation is an evaluation error rather than a pass or a fail. The postcondition is vacuously satisfied when the output contains no `llvm.func` or `func.func` operations at all; when a callable exists but owns no shape slots, the `zip_exact` conditions hold trivially yet the name-matched input callable must still exist, and when a callable owns only `llvm.intr.fmuladd` slots the three type and fast-math checks are trivially satisfied while the slot-count agreement and the existence of the matching input callable remain enforced.",
"result_index": 0,
"session_id": "42197238-e6fb-4cb5-91d0-281a957fe6b9",
"stop_reason": "end_turn",
"subagent_stats": {
"by_type": {},
"completed": 0,
"failed": 0,
"killed": {
"parent": 0,
"system": 0,
"user": 0
},
"max_depth": 0,
"refused": {
"budget": 0,
"concurrency_limit": 0,
"depth_limit": 0
},
"requested": {
"background": 0,
"foreground": 0,
"unset": 0
},
"spawned": 0,
"spawned_by_subagents": 0,
"started_in_background": 0
},
"subtype": "success",
"terminal_reason": "completed",
"time_to_request_ms": 26,
"total_cost_usd": 0.099695,
"ttft_ms": 9330,
"ttft_stream_ms": 1064,
"type": "result",
"usage": {
"cache_creation": {
"ephemeral_1h_input_tokens": 6581,
"ephemeral_5m_input_tokens": 0
},
"cache_creation_input_tokens": 6581,
"cache_read_input_tokens": 0,
"inference_geo": "not_available",
"input_tokens": 2,
"iterations": [],
"output_tokens": 1355,
"output_tokens_details": {
"thinking_tokens": 611
},
"server_tool_use": {
"web_fetch_requests": 0,
"web_search_requests": 0
},
"service_tier": "standard",
"speed": "standard"
},
"uuid": "bbd5b918-739f-42ea-9be1-ea6057cb8428"
}
]
This paired revision was activated by an explicit partial-scope team review bound to both executable artifact hashes.
Approved to run and display existing artifacts; accuracy and completeness are measured separately.