Parent: #183. Decomposes the existing #74 compatibility lane. Owns C2 TRANSLATE. Depends on C0 (#184); coordinates with Bridge #42.
Implementation brief
Build a bounded, independently implemented PTX/module front end in seeded Omega. Before edits, #74's coordinator records whether new compatibility modules live in Bridge or an attached pinned component under the proposed ownership boundary. CUDApp keeps device lowering/launch ownership. No existing source relocation.
Reference inputs: published PTX ISA and CUDA module API, the frozen profile, owned instruction fixtures and approved observations. No code/tests/data imported from ZLUDA. Vendor-generated reference payloads stay outside the repository according to AGENTS/PROVENANCE; source recipes/hashes and permitted owned fixtures are committed.
Deliver these separate draft-PR slices:
- Bounded PTX lexer/parser, declarations, types/address spaces, symbols, parameter alignment and entry metadata for the exact profile. Parse version/target/address size; every unsupported directive, opcode or modifier has deterministic refusal.
- Checked semantic lowering: registers/predicates, integer widths and overflow rules, thread/block/grid indices, pointer offsets, loads/stores, comparisons/branches and required floating operations with explicit rounding/FTZ. Emit a versioned typed artifact into the existing lowering path. If the current IR cannot express an operation, request the smallest compiler extension from its owner.
- Bounded module/fatbinary reader and image selection. Raw PTX comes first; add selected fatbin variants, compressed records and cubin metadata only after independently specified/observed formats and size checks. Refuse truncation, overflow, invalid offsets, missing entry, wrong address size, unsupported image/version and ambiguous selection. No guessed compressed format.
- Connect emitted semantic artifacts to GB10 code generation and the chosen AMD/Intel backend. Existing
backend/spirv/emit.omis a fixed-kernel builder;seed/spirv/irspirv.omhas a scalar input/result ABI. Neither constitutes an arbitrary PTX translator. Add actual PTX-driven lowering instead of matching entry names and returning canned kernels. - Cache only verified output, keyed by complete PTX/module bytes, front-end/compiler/lowerer versions, target/capabilities, ABI/options and driver/compiler dependencies that affect output. Reuse existing cache owner #158 where appropriate without expanding its scope blindly. Wrong-target, stale compiler/options and corrupt-cache controls must miss/refuse.
Initial profile can avoid warp collectives/barriers/atomics. Later addition needs active-mask/divergence semantics, CUDA warp32 versus target subgroup widths, memory scopes/order, shared-memory layout and race-sensitive tests. Merely splitting a wave64 index into two groups proves only indexing. libdevice/external symbols and device linking must either have an owned implementation or refuse explicitly. SASS-only input needs a separately scoped decoder/translator; PTX acceptance cannot close it.
Acceptance
- Every admitted instruction/modifier has independent output/refusal cases. Wrong-but-valid arithmetic must fail comparison.
- Rename/reorder entries, change constants, offsets, lengths and branching; actual PTX changes flow into code/output. Hold out valid compositions to catch canned-kernel substitution.
- Parser/capacity/module mutants reject cleanly with no partial public artifact or unintended launch.
- GB10 and SPIR-V/device code satisfy their respective validators; Kernel and Shader environments remain distinct.
- Compare permitted reference executions and Wolfram expectations. CPU/emulator conformance is labelled as such.
- C0's exact fixture loads through Bridge #42 and launches real generated code when the downstream hardware gate runs.
- Publish supported/unsupported PTX and module matrices and exact commands; no broad CUDA coverage from this bounded profile.
Delivery and closure
Follow mission #183, current repository instructions, latest issue comments and crumbs. Claim paths before work; reuse existing owners and preserve existing code locations. First-party logic and semantic tests use seeded .om. Open draft PRs with actual changes, dependency pins and behavioral red/green evidence. Require independent review of final integrated code and immutable commands, exits, source/compiler/artifact hashes. Host/emulator/physical results are distinct. No auto-close from a source-only PR or change to live services/driver state.