Correctness of named kernel lowering #
CUDA rendering uses numbered temporaries and mutable loop locals. Allocation must keep earlier
source bindings live, including across branch-result copies and repeated loop updates. The proofs
here establish that names advance monotonically and generated destinations cannot overwrite the
older allocation prefix. eval_lower then proves result agreement, including checked read errors,
for every scoped block. Scalar arithmetic is supplied without reassociation laws.
These are statements about the named evaluator. They do not establish correctness of CUDA text, NVRTC compilation or GPU execution.
Increasing the allocation bound retains every name already in scope.
A block that only writes newer locals also leaves an earlier prefix untouched.
Allocation advances monotonically, returns an in-scope name and only writes fresh locals.
An older local and a fresh destination have different CUDA spellings.
Writing outside an allocation prefix leaves every name in that prefix unchanged.
Counter writes, body execution and accumulator copies retain every older local.
Successfully executing a block with fresh destinations preserves the earlier valuation.
A successful projected result comes from a successful unprojected valuation.
Projecting successful values cannot create or change a checked error.
A body simulation and preserved invariant compose over the exact bounded step order.
Copying the selected branch result retains its value and its read failures.
Running an allocated block leaves every previously allocated local unchanged.
The initial source names must lie before the allocation counter. This theorem applies to a successful run; failed reads do not produce an output valuation.
Allocating scoped blocks into named statements preserves their result and checked errors.
The initial named valuation must represent the source scope, whose names lie below the allocation counter. Other initial local values are arbitrary. Arithmetic is supplied without algebraic laws: the theorem preserves the specified operation and accumulation order, not a reassociated formula. It concerns named semantics, not execution of rendered CUDA by NVIDIA's compiler and device.