LeafKernelCache
The leaf probe's programs: one per definition, function and revision (leaf-probe §LPD-4).
In the namespace construct::eval. Declared in src/libs/libconstruct/construct/eval/LeafKernelCache.hpp.
Detailed description
A kernel is a definition's own shader code and one call in the shape the GPU uses (ShaderWrapperGenerator): `op_X(p, <glslArgumentList>)`, with `p`, `params` and `params2` as inputs. A value is an input, so a drag compiles nothing (D8). The key holds Definition::contentHash(), so an edit compiles again, once. A failure is cached too.
A definition with a `data:` block reads its own table, the table of the definition alone (definition-taxonomy §DTX-S1b, construct::shader::definitionDataKernelCode()), as an input of the program.
Backends
Gate G1 (§LPD-10): an interpreted run costs 50 to 82 µs, a Native batch row 0.73 µs. The interpreted program compiles at once and serves the first runs; the Native one compiles on this cache's own pool and replaces it when ready. A cache built with Mode::Synchronous compiles Native at once instead: for a worker thread with no frame to keep, and for tests.
Threads
A cache belongs to one thread. Program::evaluateBatch has no per-thread copy, and its general path writes the program's state, so the GUI's leaf probe and the batch renderer's each own a cache. Only the Native compile runs elsewhere, and it hands its program over under the lock.