Roadmap

LLVM IR constructs

Written by scripts/roadmap_llvm.py from the importer, the rule table, the corpus and its refusals. Do not edit; run python3 scripts/roadmap_llvm.py after changing one of them.

Scope

The LLVM IR the 116 corpus files use: every opcode the importer reads that some corpus file uses, every intrinsic family some corpus file calls, every form of inline assembly the importer accepts, and every construct the importer refuses. The corpus IR declares no LLVM version (it has no llvm.ident); the cards cite the LangRef and PTX ISA versions the semantics was read from (LangRef 24.0.0git, PTX ISA 9.5, docs/TRUST.md T7). An opcode or family card is L1 when its lean names exist and the semantics runs the construct: the grid evaluator runs a kernel of it until every thread returns, the row returns of the table MojoProofTest/Modelled.lean pins (its build checks the table). A construct the importer reads and the semantics stops at (with unsupported or another fault) is L0, parsed but not modelled, and its card says so.

Items

Opcodes

Intrinsic families

Accepted inline assembly

Refused constructs

Out of scope

Opcodes the importer reads (51 keywords) that no corpus file uses, and intrinsic families no corpus file calls: the cards follow the corpus. Calls of functions defined in the module are calls, not intrinsics, and have no card of their own.

Depends on

The corpus (tests/corpus/MANIFEST.tsv) and the importer's tables; the reading of LangRef and PTX ISA (docs/TRUST.md T7, T9, T10).

Coverage in MojoProof

56 of the 58 opcode and family cards are L1: the importer reads the construct, MojoProof.Sem.exec, MojoProof.Sem.step or MojoProof.Sem.intrinsic gives it a meaning, and the grid evaluator runs a kernel of it to the end (MojoProofTest/Modelled.lean); the card repeats the block checker's rules and refusals for its constructors. The intrinsic-ldmatrix and intrinsic-mma cards are L0, parsed but not modelled: the semantics stops a run at the construct. The accepted inline asm cards asm-cp-async-cg-shared-global-3 and asm-cp-async-cg-shared-global-4 are L0: the importer accepts the call, and MojoProof.Sem.exec stops a run at it. The refused constructs are L0. 20 of the L1 cards are L2: a record of a GPU run that agrees with the evaluator ran a corpus kernel whose IR uses the construct (tests/gpu/naive/record.txt, tests/gpu/vadd/record.txt, tests/gpu/vmul/record.txt, tests/gpu/vsub/record.txt; a conformance test, not a proof). 20 of the L2 cards are L3: a kernel card with L2 evidence, a proved kernel, has a Kernel.Sound theorem about a program whose IR uses the construct. The proved kernels, their L2 theorems and the corpus files of the programs those are about (the program of the elaborated conclusion and the corpus file of the imported program it unfolds to, programs.tsv, which scripts/L3Programs.lean writes; the other files a kernel card cites do not count): naive-matmul: MojoProofTest.NaiveKernel.correct (tests/corpus/mgemm/g_matmul_kernel_naive_float32_float32_float32_True_16_16826c8c.nvptx.ll), MojoProofTest.NaiveOff.correct (tests/corpus/mgemm_nocontract/g_matmul_kernel_naive_float32_float32_float32_True_16_16826c8c.nvptx.ll); vadd: MojoProof.Kernels.vadd.correct (tests/corpus/vadd/vadd_vector_addition_vector_addition6A6A_793e5fe36a195e73.nvptx.ll); vmul: MojoProof.Kernels.vmul.correct (tests/corpus/vmul/vector_multiply_vector_multiply_vector_multiply6A6A_227fc544da3deaff.nvptx.ll); vsub: MojoProof.Kernels.vsub.correct (tests/corpus/vsub/vector_subtraction_vector_subtraction_vector_subtr6A6A_a0b4d9d2b6e652e1.nvptx.ll). L3 here means used by a proved kernel, not that the construct has a theorem of its own: a kernel's theorem covers the forms of the construct in the IR of its program, at the launches and on the memories its premises admit, and no other form.

Next steps

Status of the cards

From roadmap/status.yaml, which the roadmap script writes from the code.

CardKindLevelEvidence above the levelNextCorpus kernels
asm-cp-async-cg-shared-global-3: Inline asm cp.async.cg.shared.global with 3 operandsconstructL0-L1 needs a Lean model5
asm-cp-async-cg-shared-global-4: Inline asm cp.async.cg.shared.global with 4 operandsconstructL0-L1 needs a Lean model5
inst-add: The add instructionconstructL3-top level5
inst-addrspacecast: The addrspacecast instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-alloca: The alloca instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-and: The and instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-ashr: The ashr instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-atomicrmw: The atomicrmw instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)1
inst-bitcast: The bitcast instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-call: The call instructionconstructL3-top level5
inst-extractelement: The extractelement instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-extractvalue: The extractvalue instructionconstructL3-top level5
inst-fadd: The fadd instructionconstructL3-top level5
inst-fdiv: The fdiv instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-fmul: The fmul instructionconstructL3-top level5
inst-fpext: The fpext instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-fptrunc: The fptrunc instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-fsub: The fsub instructionconstructL3-top level5
inst-getelementptr: The getelementptr instructionconstructL3-top level5
inst-icmp: The icmp instructionconstructL3-top level5
inst-insertelement: The insertelement instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-insertvalue: The insertvalue instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-load: The load instructionconstructL3-top level5
inst-lshr: The lshr instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-mul: The mul instructionconstructL3-top level5
inst-or: The or instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-phi: The phi instructionconstructL3-top level5
inst-ptrtoint: The ptrtoint instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-sdiv: The sdiv instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-select: The select instructionconstructL3-top level5
inst-sext: The sext instructionconstructL3-top level5
inst-shl: The shl instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-shufflevector: The shufflevector instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-sitofp: The sitofp instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)3
inst-store: The store instructionconstructL3-top level5
inst-sub: The sub instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-trunc: The trunc instructionconstructL3-top level5
inst-udiv: The udiv instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-urem: The urem instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-xor: The xor instructionconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
inst-zext: The zext instructionconstructL3-top level5
intrinsic-barrier: The intrinsic family Intrinsic.barrierconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-cpasynccommit: The intrinsic family Intrinsic.cpAsyncCommitconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-cpasyncwait: The intrinsic family Intrinsic.cpAsyncWaitconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-extract: The intrinsic family Intrinsic.extractconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-fminmax: The intrinsic family Intrinsic.fminmaxconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-griddeplaunch: The intrinsic family Intrinsic.griddepLaunchconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-griddepwait: The intrinsic family Intrinsic.griddepWaitconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-laneid: The intrinsic family Intrinsic.laneidconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-ldmatrix: The intrinsic family Intrinsic.ldmatrixconstructL0-L1 needs a Lean model5
intrinsic-lifetime: The intrinsic family Intrinsic.lifetimeconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-minmax: The intrinsic family Intrinsic.minmaxconstructL3-top level5
intrinsic-mma: The intrinsic family Intrinsic.mmaconstructL0-L1 needs a Lean model5
intrinsic-reduceand: The intrinsic family Intrinsic.reduceAndconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-rsqrtapprox: The intrinsic family Intrinsic.rsqrtApproxconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-shfl: The intrinsic family Intrinsic.shflconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
intrinsic-sreg: The intrinsic family Intrinsic.sregconstructL3-top level5
intrinsic-stepvector: The intrinsic family Intrinsic.stepvectorconstructL1-L2 needs a recorded GPU run (a conformance test, not a proof)5
refused-asm-cvt-rn-f16x2-e4m3x2-2: Refused: inline asm cvt.rn.f16x2.e4m3x2 with 2 operandsconstructL0-L1 needs a Lean model4
refused-asm-cvt-rn-satfinite-e4m3x2-f32-3: Refused: inline asm cvt.rn.satfinite.e4m3x2.f32 with 3 operandsconstructL0-L1 needs a Lean model3
refused-load-atomic: Refused: load atomicconstructL0-L1 needs a Lean model0
refused-store-atomic: Refused: store atomicconstructL0-L1 needs a Lean model0
term-br: The br terminatorconstructL3-top level5
term-ret: The ret terminatorconstructL3-top level5