Adds v_cmp_{lt,eq,le,gt,ne,ge}_{i32,u32}_e32 across the chain: opcodes
generated from the pinned AMD XML, one typed VectorCompare instruction
(relation + signedness, table-driven decode), the reference interpreter,
the independent semantic-review interpreter, typed IR and MSL.
Rules (RDNA 2 ISA guide 3.9, 2.1, 3.3; contract in
docs/shaders/vector-compare.md): VCC_LO[n] = EXEC_LO[n] & test(lane n),
always fully written, so empty EXEC gives 0 and reads no source; VCC_HI
becomes unknown; EXEC, SCC and VGPRs are unchanged. A lane-derived
VCC_LO may feed only s_cbranch_vccz, v_mov_b32 vN, vcc_lo and another
compare's SRC0, so EXEC never becomes data-dependent. A runtime
s_cbranch_vccz is wave-uniform: the skipped code may hold only integer
vector ALU instructions with initialized destinations, checked whether
or not it is taken, and lowers to selects at the join.
The Metal kernel makes no SIMD-group, threadgroup or barrier assumption:
each thread rebuilds its RDNA wave's mask by recomputing the 32 lanes'
operands from their input words, bounded by threads_per_grid. The
reference now runs lockstep Wave32 waves; absent lanes of a final
partial wave contribute 0.
Verified with an original LLVM-assembled fixture and 251 programs
(every form on 10 boundary values in both operand orders, partial and
empty EXEC, both runtime branch edges in one dispatch, mask chains,
32 pinned rejections) against exact integer definitions. Translator,
reference and second interpreter agree on CPU; all 252 programs match
on native Metal with validation; LLVM agrees on every encoding.
Breaking any implementation (signedness, EXEC masking, empty EXEC,
absent-lane bound, join polarity or uniformity) fails the tests.
Fixes #186
Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
4.0 KiB
Xenora documentation
Getting started
Start with the project README for scope and build commands, then read the interface contracts. Reproduce an original guest test program or run the independent validation suite before changing either path. The changelog records notable changes.
Architecture and technical design
- Interface contracts — Shader inputs, guest services, native command submission, and synthetic textures.
- Fixture memory model and CPU boundary — Buffer bindings, guest address translation, and dependency direction.
RDNA 2 decoding and shader translation
- Instruction coverage — Desktop gfx1030 instruction forms, operand limits, and CPU and GPU results.
- SOP2 scalar ALU — Supported scalar add, subtract and bitwise forms, their SCC rules and sources.
- VOPC integer compares — Wave32 compare forms, the VCC/EXEC contract, runtime
s_cbranch_vcczand the Metal mapping. - Metal Shading Language generation and independent CPU reference — Translation rules and separate CPU execution models.
Native Metal backend
- Compute interface — Resource limits, dispatch, completion, and profiling.
- Apple GPU evidence and host lab record — Observed behavior and historical floating-point results.
Guest CPU and runtime experiments
- Guest experiment guide — Bounded x86-64 execution, executable loading, experimental services, native compute, and offscreen rendering.
- Guest CPU research — Public specifications and unresolved console requirements.
- Synthetic import fixtures — Reproducible PE32+ builds and expected service behavior.
Testing, validation, and benchmarks
-
Engineering progress — Verification commands, metric definitions, and open release gates.
-
Test inventory comparison — Detect missing or newly ignored Cargo tests across commits.
-
Persistent resource and translated rendering acceptance — Pinned upstream tests, native ARM64 results and unsupported cases.
-
Baseline acceptance, Phase 01 assurance, and independent reviews — Candidate-specific results and release findings.
-
Mutation testing and benchmark protocol — Test sensitivity, benchmark inputs, and timing requirements.
Research and engineering decisions
- Public sources, RDNA 2 notes, and Xbox GPU evidence — Specifications, evidence scope, and unknown console behavior.
- Shader inputs and risk register — Input provenance and unresolved engineering risks.
- Synthetic integration and upstream evidence — Audited source snapshots and remaining commercial startup prerequisites.
Security, licensing, and contributions
- Threat model and security reporting — Execution limits and disclosure instructions.
- Legal scope, dependency licensing, and third-party notices — Input policy, attribution, and redistribution findings.
- Contribution guidelines — Original authorship, Developer Certificate of Origin sign-off, and evidence requirements.
- Agent task queue — Areas, claiming, leases, upstream sync, verification and the security model for parallel contributors and coding agents.