Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/issues/9526f23dbb9d8764 # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers # [KCACHE-1] Content-keyed encoded-kernel cache with sealed prewarm and safe lifetimes Closed · #158 · open 2026-10-28 11:15 UTC · closed 2026-10-28 17:23 UTC (reason completed) Imported from GitHub aien-dev/CUDApp#158, by drakestapleton drakestapleton wrote on 2026-10-28 11:15 UTC ## Goal Unify kernel artifact identity, preparation and residency policy across the existing caches. Current FP8 GEMV cache has 16 slots with pinned kernels and sealed-serving refusal; `src/omega_gpu_tcgemm_api.c` and `src/omega_gpu_fp8gemm_api.c` have 8 slots each. Reuse this code and GPU session lifetime behavior; do not add a second allocator or serving runtime. `CUDApp` main `b759afc3f5e46f152ffb06b39882ffa28cacaf96` and `omega-mv` main `6999fa9e6dae4847c155ef4eacaece74f491d3ca` inspected 2026-10-28. Reinspect heads, active branches and complete source/receipts before editing. ## Delivery slices - Freeze a canonical, versioned, padding-independent realization cache key: semantic task/contract; M/N/K or bounded shape family/tail/strides; all types, quant/scale/zero-point physical layout IDs; tile/warps/stages/pipeline family; numerical/synchronization mode; sm_121 target and demonstrated feature set; IR/encoder/spec/seed source identity and code/launch ABI. Shape-only or `memcmp`-on-uninitialized-struct keys are insufficient. - Separate distinct lifetimes: reusable compiled host artifact; validated code blob; device-uploaded kernel and launch metadata; sealed/pinned recording references. Content-addressed host artifact reuse must be revalidated for target/session; device handles and addresses are never portable. - Extend current prewarm/reservation for known Q36 decode, grouped expert, prefill and test shapes. During sealed graph recording a cache miss must deterministically refuse or follow an expressly admitted preexisting compatible path; no unbudgeted compile, GPU allocation or evict of in-flight code. - Bounded memory and concurrency: max resident bytes/slots, deterministic victim rules, immutable pinned references, session generation/invalidation on device reset/recovery/driver/encoder/target/profile changes, clean retirement after command lists complete. - Collect cache warmup/compile/verify/upload/record/launch times, hit/miss/eviction rates, code memory and request latency. Reuse #17 reporting and #57 selection; no benchmark changes under the guise of a cache win. ## Acceptance / negative gates - Pinned warm decode workloads show zero code regeneration and zero unsafe eviction during recorded use; cold setup costs visible. - Key invalidates for changed scale layout, pipeline, tile, encoder, instruction spec, contract, driver/session generation and target; negative controls catch false hit and stale code address. - Concurrent registration, sealed miss, budget exhaustion and interrupted completion refuse/recover without use-after-free or hidden allocation. - Paired warmed/cold full-model and micro-bench result; if preparation savings are not on the measured hot path, report NO-GAIN rather than claiming TPS. Delivery rules. New first-party production code/tests are native seeded `.om`; C sources can serve as migration/differential oracles until qualified cutover under #79 . Preserve immutable receipts, one writer per shared file, no second GPU session/driver/IR/compiler. No silent CUDA/PTX/cuBLAS dependency. Keep the live 35B, driver and hardware scheduling unchanged; chip tests require an authorized GB10 window. Label HOST_TESTED/SIMULATED/CHIP_EXERCISED/WHOLE_MODEL_QUALIFIED separately; NOT_RUN/BLOCKED cannot become PASS. Record exact source/seed/compiler/target/binary/model hashes, commands/exits, positive and mutation results, baseline/variant raw timings. ## Workstream links (2026-10-28) Cache identity consumes #156 quant schema and #157 component realization and is selected by existing #57 . The grouped MoE work list #159 may preload its bounded specializations, but no user data/weights are included in a code-cache key unless they alter generated code. Device memory, weights and code handles have different lifetimes. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:17 UTC Recovered GitHub comment. Original comment `6470453250` PR161 updated at SSH-signed79d17381f9489922828f4555007ee1af150b4568 with pure seeded retained ELF ABI/cbank/QMD/manifest-ID consistency checking, not new admission authority. Canonical SHA cache identity/residency modules remain unchanged. Pinned compiler2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f; native38 positive/refusal cases exit0, eight guard-removal mutants caught, final Omega MCP sandbox normal0. Immutable independent admitted exporter fixture and exact receipt: om/cache/templates-evidence.json. Existing-runtime caller integration/bridge/custody acceptance is NativeIntegrate/Main-owned and pending; fixture tests do not substitute for it. Hardware upload timing, device execution and whole-model acceptance NOT_RUN. #158 stays OPEN; PR161 stays DRAFT, unlabelled; no merge/deploy/GPU authority used. Refs #26. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:21 UTC Recovered GitHub comment. Original comment `6471013278` Native retained-template correction: signed source `3cc6140267a77dcd00f7bab33963725682f61847` (draft PR161), templates.om SHA08b8f9aad44cf64bc74653ceb314c78109bbaf59cd3d0ff2132fbc29d32f27c3. Actual bridge preparation exposed that original 79d173 program-mode fixture did not establish production bare-function compatibility: pinned `e5b32567` fnstore rejects top-level text globals (EOF error9). Removed all four globals using existing filed packed-word constants, no allocation or ABI/schema change. Exact quant+realize+digest+templates production function image now compiles locally and via mounted pinned2c824805 Omega MCP,40832bytes SHA11b5bee6e72867e5a14cd221b5d9afb5053b3cfad9540bc4edd0b83c430e4724. Text-global negative control rejects9. Same-source native38 assertions, byte-identical independent exporter fixture, eight caught guard mutants and sandbox normal0 exercised. New immutable om/cache/templates-function-evidence.json; earlier receipts unchanged. NativeIntegrate owns real bridge regeneration/FP8-GEMM retained-snapshot caller smoke; not replaced by these module tests. Hardware upload timing/device/full-model acceptance NOT_RUN, no GPU/service/merge/deploy. Keep #158 open and PR draft/unlabelled. Exact integration requirements: /home/drakestapleton/handoffs/kernel-cache-native-templates-handoff-`20261028`.md. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:26 UTC Recovered GitHub comment by @aien-spark on 2026-10-28T11:58:10Z. Original comment `6468376581` Draft #161 carries signed native cache source `f0909113243674eeda1cf7539710ac425978e2f1` (baseline `b759afc3f5e46f152ffb06b39882ffa28cacaf96`). IMPLEMENTED: exact Composer/QuantSchema SHA-256 identity and payload validation; bounded transactional residency, owner/revision/generation refusal, deterministic budgeted victims, prepare/pin/seal/acquire/completion-retire/invalidate. No second canonical format, allocator, session, runtime or device wrapper. Existing artifact manifest/admit remains authoritative. EXERCISED host only with pinned compiler SHA2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f: digest vectors through16384 bytes versus independent hashlib SHA256; native lifetime/interleaved registration/interruption tests; canonical serializer-to-residency caller; changed scale/tile/spec/target/numerical identity and payload negatives. Removed in-flight guard, omitted QuantSchema hash bytes, invalid launch-declaration acceptance and SHA round-constant mutants are caught. Exact sources/executables/dependencies in om/cache/host-evidence.json. Omega lookup/compile/run/explain_error used. NOT_RUN: actual existing GEMV/GEMM/TC runtime-facing host lifecycle smoke until Main-owned shared caller/bridge/build cutover; hardware upload timing; full physical and whole-model acceptance. Main has exact integration API/source requirements. #158 remains open; #161 draft/unlabelled, no merge/deploy or hardware qualification claimed. Refs mission #26. Sign in to comment