Compare commits

...
Author SHA1 Message Date
Vedant Dadhich fec13fa27a Scripts: allow longer Metal semantic-review runs
The full semantic-review batch can exceed the hard-coded 120-second timeout on a cold Apple Silicon host. A local M1 acceptance run exited 124 while tests were still progressing; the same batch passed with a longer limit. Add XENORA_SEMANTIC_TIMEOUT, default it to 300 seconds, and document the override.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
2026-11-25 00:57:15 +05:30
Zach Doxsee 0115af5c04 Merge pull request #332 from vedantdadhich21/docs/gfx1030-form-acceptance
Docs: define gfx1030 form acceptance
2026-11-24 20:19:26 +01:00
Zach Doxsee 5b7ffec90a Merge pull request #347 from Arths17/task/109-relocation-overhead
loader: avoid per-entry relocation histogram lookups
2026-11-24 20:15:11 +01:00
Zach Doxsee 48c5d20aa9 Merge pull request #335 from izdat-sl4w/fix/audit-utf8-locale
audit: read and write tracked files as UTF-8
2026-11-24 20:14:57 +01:00
izdat-sl4w 8049c36f51 audit: pin LF newlines in the generated status writes
Path.write_text opens with newline=None, so on Windows a regeneration
would translate the tracked LF files to CRLF and show a spurious diff.
Both write sites now pass newline="\n", which leaves the bytes
identical on macOS and Linux.

Signed-off-by: izdat-sl4w <76667566+izdat-sl4w@users.noreply.github.com>
2026-11-24 20:14:45 +01:00
izdat-sl4w c91036f879 Merge main into fix/audit-utf8-locale
Signed-off-by: izdat-sl4w <76667566+izdat-sl4w@users.noreply.github.com>
2026-11-24 20:14:30 +01:00
Vedant Dadhich dc3b02b62f Merge latest main into docs/gfx1030-form-acceptance
# Conflicts:
#	CHANGELOG.md
2026-11-24 23:14:13 +05:30
Vedant Dadhich d847d7ea6e Docs: clarify gfx1030 acceptance terminology
Address review feedback: introduce AMD RDNA2 desktop GPU (gfx1030) before the internal codename, define the LLVM three-way decoder check, document the Apple M5 status spelling, use GitHub logins in acceptance records, and mark the independence rule as proposed pending maintainer confirmation.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
2026-11-24 23:11:55 +05:30
Vedant Dadhich b55a4c24ef Merge main into docs/gfx1030-form-acceptance
# Conflicts:
#	CHANGELOG.md
2026-11-24 23:08:10 +05:30
izdat-sl4w d01627b3de audit: read and write tracked files as UTF-8
The generated-status check and the claims audit called
Path.read_text()/write_text() without encoding=, so they used the process
locale encoding. Under an ASCII locale the status check raises
UnicodeDecodeError on docs/claims.toml, and under cp1252 it reports a
spurious xenora-progress.svg difference, so a current tree fails the
documented checkout command. Both scripts now pass encoding="utf-8", as
the rest of scripts/ does, and CI runs the two checks again under a
non-UTF-8 locale so the requirement stays enforced.

Closes #334

Signed-off-by: izdat-sl4w <76667566+izdat-sl4w@users.noreply.github.com>
2026-11-24 18:09:21 +01:00
Vedant Dadhich 291c9807ee Docs: define gfx1030 form acceptance
Add the promotion rule for moving desktop gfx1030 forms from local CPU and Metal results to fixture verified. The rule records clean-commit evidence, independent-runner requirements, exact commands, raw-log location, review-log summaries, failure handling and status regeneration. This is documentation only: no status rows, tests or fixtures change. Part of #302.

Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
2026-11-24 22:24:18 +05:30
10 changed files with 170 additions and 12 deletions

No files matched your search

+3 -1
View File
@@ -41,6 +41,8 @@ jobs:
python3 crates/isa/generate_semantics.py --check
python3 scripts/audit/semantic_coverage.py --check
python3 scripts/audit/status.py --check
# The generated status check must not depend on the host locale encoding.
LC_ALL=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 python3 scripts/audit/status.py --check
for fixture in x2 x3 x4; do
python3 "experiments/x1/fixtures/$fixture.py" --check || exit 1
done
@@ -65,7 +67,7 @@ jobs:
cargo test --locked --workspace
cargo test --locked --manifest-path experiments/x1/Cargo.toml
scripts/audit/dependencies.sh
scripts/audit/claims.sh
LC_ALL=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 scripts/audit/claims.sh
- name: Inspect native CLI
run: |
cargo build --locked -p xenora
+5
View File
@@ -17,7 +17,11 @@ remains unsupported.
- Added non-blocking Metal compute submission through `submit_words` and `wait`, with completion-aware resource retirement and a sixteen-dispatch in-flight limit. Synchronous calls keep their existing behavior. The benchmark reports the host submission split and compares synchronous and pipelined batches.
- Extended the read-only RDNA2 planning CLI (`python3 -m qa rdna2`) with family/status filters, compact summaries, Codex-ready manifests under `artifacts/`, active-claim exclusion (family claims exclude those families; path-only claims block overlapping permitted files), coverage reconcile against `semantic_coverage` without inflating counts, and inventory diffs. Covered by `tests/qa/test_rdna2_plan.py`; planning only, no GPU production edits.
### Fixed
- Made the native semantic-review timeout in `scripts/test-gpu.sh` configurable with `XENORA_SEMANTIC_TIMEOUT` and raised its default from 120 to 300 seconds, so cold Apple Silicon runs do not fail while the expanded Metal known-answer suite is still progressing.
### Added
- Added a documented independent acceptance rule for promoting AMD RDNA2 desktop GPU (gfx1030) forms from local CPU and Metal results to `fixture verified`, including clean-commit evidence, reviewer independence, raw-log location, review-log summary, failure handling and status regeneration (#302).
- Added the VOP3A (`_e64`) encodings of eleven gfx1030 VOP2 integer forms (`v_mul_{i32_i24,hi_i32_i24,u32_u24,hi_u32_u24}`, `v_{min,max}_{i32,u32}`, `v_xnor_b32`, `v_sub_nc_u32`, `v_subrev_nc_u32`) and of the sixteen Wave32 integer compares (explicit SGPR mask destination, `s_cbranch_vccz` through `vcc_lo`, a translation error for reads of runtime-only SGPR results) as semantic-registry encoding variants, with VGPR sources only. New fixtures `vop3-integer` and `vop3-compare` with IR and MSL goldens, and an independent guide-derived oracle (`tests/validation/tests/vop3_{integer,compare}.rs`) that agrees on both reference interpreters and on native Metal. Part of #215.
- Added guest texture binding through D3D12-style descriptor tables (#303): shader-visible CBV_SRV_UAV and sampler heaps, `CreateShaderResourceView` for one-level RGBA8 and BC1 2D textures, a point/clamp `CreateSampler`, a root signature with one pixel-stage SRV table and one sampler table, and `SetDescriptorHeaps`/`SetGraphicsRootDescriptorTable` in `crates/loader/src/graphics.rs`, plus `NativeCompute::render_rgba8_sampled_bc1`. Verified locally on an Apple M5 Pro under Metal validation: a guest draw with the translated `image_sample_lz` pixel stage matches the software reference and hand-derived images on 16 of 16 pixels for two RGBA8 textures and 64 of 64 for an 8×8 BC1 texture. A wrong descriptor slot changes the image, off-centre and out-of-range coordinates point-sample with clamping, and a rejected binding, draw shape or resource state never reaches the backend. The software reference samples BC1 with the spec-exact decoder, while Apple's hardware rounds BC1's interpolated palette entries differently (171/84 against 170/85), so the BC1 fixtures use only endpoint colours. Not yet reachable from guest imports. Not yet independently accepted.
- Added four Wave32 gfx1030 VOP2 select and carry forms through the semantic registry. Conditional select, add with carry and both subtract orders with borrow use a per-lane VCC bit and have a guide-derived oracle that passes on both CPU interpreters and on native Metal (local Apple M5, API and shader validation); independent acceptance is pending. Part of #215.
@@ -197,6 +201,7 @@ remains unsupported.
- Fixed 32-bit guest stores and loads in the native DBT (MOV 89/8B and C7 /0), which accessed eight bytes: stores overwrote the next four guest bytes and accesses at the end of a mapping faulted. RIP-relative operands of byte moves and extensions, which were read as RBP-relative, and LEA with a segment prefix, which added the segment base, are fixed too.
- Fixed an x86 prefix-length test that read an untracked fuzz artifact and so failed on every fresh checkout; its input is now inline.
- Fixed agent-queue `apply_actions` crashing on comment-only decisions (claim refusals) by skipping no-op `gh issue edit` calls; accept `summary --now` after the subcommand; grant the audit job `pull-requests: read` so live audits can list open PRs (issue #180).
- Fixed `scripts/audit/status.py` and the Python embedded in `scripts/audit/claims.sh` reading and writing tracked files in the process locale encoding instead of UTF-8: under an ASCII or cp1252 locale the status check crashed on `docs/claims.toml` or reported a spurious `xenora-progress.svg` difference. Both scripts now pass `encoding="utf-8"`, as the rest of `scripts/` does, the two write sites also pin `newline="\n"` so a Windows host cannot turn tracked LF files into CRLF when it regenerates them, and CI runs the two checks again under a non-UTF-8 locale so the requirement stays enforced.
- Generated CRT adapters now report unsupported calls when the required guest ABI or runtime behavior is missing.
+1 -1
View File
@@ -309,7 +309,7 @@ These require a Metal-capable Apple Silicon Mac.
scripts/test-gpu.sh
```
The native test suite enables Metal API and shader validation and tests the supported compute, rendering and texture paths.
The native test suite enables Metal API and shader validation and tests the supported compute, rendering and texture paths. The full semantic-review batch defaults to a 300-second timeout; set `XENORA_SEMANTIC_TIMEOUT` to raise or lower it for a slower or faster host.
### Verify guest execution
+2
View File
@@ -40,6 +40,8 @@ either path. The [changelog](../CHANGELOG.md) records notable changes.
## Testing, validation, and benchmarks
- [Testing and acceptance index](testing/README.md) — Entry point for test procedures, evidence and review records.
- [AMD RDNA2 desktop GPU (gfx1030) form acceptance](testing/shader-form-acceptance.md) — Independence, command, log and promotion rules for fixture-verified instruction forms.
- [Engineering progress](progress.md) — Verification commands, metric definitions, and open release gates.
- [Test inventory comparison](testing/test-inventory.md) — Detect missing or newly ignored Cargo tests across commits.
- [Persistent resource and translated rendering acceptance](testing/x9-acceptance.md) — Pinned upstream tests, native ARM64 results and unsupported cases.
+9
View File
@@ -0,0 +1,9 @@
# Testing and acceptance
- [AMD RDNA2 desktop GPU (gfx1030) form acceptance](shader-form-acceptance.md) — Rule and evidence required to promote a form from local results to `fixture verified`.
- [Test inventory comparison](test-inventory.md) — Detect missing or newly ignored Cargo tests across commits.
- [Persistent resource and translated rendering acceptance](x9-acceptance.md) — Native ARM64 results and unsupported cases.
- [Baseline acceptance](phase-02-baseline.md) and [Phase 01 assurance](phase01-assurance.md) — Candidate-specific evidence.
- [Independent reviews](review-log.md) — Review findings and acceptance records.
- [Mutation testing](mutation.md) and [benchmark protocol](benchmarks.md) — Sensitivity and timing requirements.
- [Infrastructure QA tooling](infrastructure/README.md) — Advisory orchestration, PR validation, benchmark analysis and release checks.
+7
View File
@@ -1,5 +1,12 @@
# Independent review
## gfx1030 form acceptance
Use the [AMD RDNA2 desktop GPU (gfx1030) form acceptance rule](shader-form-acceptance.md) for entries that
promote instruction forms to `fixture verified`. Record only completed runs with
a named commit, independent runner, host, exact commands and real counts. Raw
logs stay under ignored `artifacts/acceptance/<commit>/`.
## R1. First synthetic compute checkpoint, 2026-11-22
Reviewed the integrated working tree before a candidate commit. The findings below cover the first checkpoint.
+129
View File
@@ -0,0 +1,129 @@
# AMD RDNA2 desktop GPU (gfx1030) form acceptance
This is the promotion rule for AMD RDNA2 desktop GPU (`gfx1030`) instruction
forms in [`docs/status.toml`](../status.toml). It implements the documentation
step of [#302](https://github.com/ranveersoni98/Xenora/issues/302). It does not
claim Xbox-hardware verification or commercial-game compatibility.
The **LLVM three-way decoder check** is the ignored `llvm-mc` comparison in
[`crates/decoder/tests/gfx1030.rs`](../../crates/decoder/tests/gfx1030.rs). It
compares Xenora's decoder with LLVM's gfx1030 decoder over the fixture and
probe encodings; it is encoding evidence, not GPU-semantics evidence.
## Status meanings
| Status | Meaning |
| --- | --- |
| `local known-answer test passed` | The implementation's CPU known-answer test passed locally. This is not independent acceptance. |
| `local Apple M5 readback passed; acceptance pending` | A local native Metal readback passed with validation, but the independence and evidence rules below are incomplete. |
| `fixture verified on Apple M5` | The host-qualified spelling used by three existing rows. `scripts/audit/status.py` treats it as equivalent to `fixture verified`; existing rows do not need re-acceptance solely for this wording. New entries should normally use `fixture verified` and record the host in the review log. |
| `fixture verified` | The form or documented family batch passed independent acceptance at a named commit, with CPU, LLVM and native Metal evidence recorded. |
A skipped test is not a pass. A shader compile without readback is not GPU
verification. Agreement with a spec-derived reference is not agreement with
Xbox hardware.
## Independence
> **Proposed policy, pending maintainer confirmation.** The independence rule in
> this section is the proposal from #302. Do not use it to promote forms until
> the maintainer confirms or revises it.
The person running the acceptance pass must not be the author of the pull
request that added the form being accepted. The runner may use the existing
tests and commands, but must record their own results and review the evidence.
If the maintainer runs the pass for forms they authored, the review-log entry
must say so explicitly; that exception is not silent self-certification.
The expected values used by the test must remain independent of the production
decoder, translator or Metal backend. Do not change fixtures, thresholds or test
filters to make a form pass.
## Acceptance procedure
1. **Use a clean named commit.** Start from a clean checkout of `main` at the
commit being accepted. Record the full commit hash. Do not accept a working
tree with uncommitted changes.
2. **Name the scope.** List each form, or a family batch with an explicit list of
forms, covered by the pass. A family name alone is not enough.
3. **Run the standard gates.** Format, Clippy, workspace tests, fixture checks,
the LLVM three-way decoder check and the native GPU suite must pass. Record
exact commands, environment variables and pass/fail/skip counts.
4. **Run the form's CPU and Metal tests.** The CPU known-answer/reference tests
and the native Metal readback must both pass. Metal API and shader validation
must be enabled. Use a targeted test filter where useful, but keep the full
standard-gate result for the same commit.
5. **Check negative cases.** Unsupported encodings, malformed inputs and any
documented rejection cases for the form must still pass.
6. **Save raw logs.** Put raw output under ignored
`artifacts/acceptance/<commit>/`. Do not commit raw logs.
7. **Write the review-log summary.** Add an entry to
[`review-log.md`](review-log.md) with the commit, runner's GitHub login, host,
scope, exact commands or log path, and CPU/LLVM/Metal results. A reviewer
confirms the entry if the runner is not the maintainer.
8. **Promote only passed forms.** Change `cpu` and `gpu` in `docs/status.toml`
only for forms covered by a passing entry. Regenerate the status tables and
progress graphic, then run `python3 scripts/audit/status.py --check`.
## Standard gate set
Run on native Apple Silicon. The exact host and tool versions belong in the
review-log entry.
```sh
export CARGO_BUILD_JOBS=2
cargo fmt --all -- --check
cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
cargo test --locked --workspace
scripts/assemble-fixture.sh --check
LLVM_BIN="$(brew --prefix llvm)/bin" \
cargo test --locked -p xenora-decoder --test gfx1030 -- --include-ignored --nocapture
cargo test --locked -p xenora-semantic-review
scripts/test-gpu.sh
python3 scripts/audit/status.py --check
```
For a targeted semantic-review pass, record the filter and use the same Metal
validation environment as `scripts/test-gpu.sh`:
```sh
cargo test --locked -p xenora-semantic-review <cpu-test-filter>
MTL_DEBUG_LAYER=1 \
MTL_SHADER_VALIDATION=1 \
MTL_SHADER_VALIDATION_REPORT_TO_STDERR=1 \
MTL_SHADER_VALIDATION_ABORT_ON_FAULT=1 \
cargo test --locked -p xenora-semantic-review <native-metal-test-filter> \
-- --ignored --exact --nocapture --test-threads=1
```
A targeted filter does not replace the standard gate set; it attributes the
result to a form or family batch.
## Review-log entry
Use one row per commit and scope. Add rows to
[`review-log.md`](review-log.md); keep raw output only in `artifacts/`.
| Date | Commit | Runner (GitHub login) | Host and tools | Forms or batch | Commands / raw log | CPU | LLVM | Metal | Review |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| YYYY-MM-DD | full SHA | @login | Mac, macOS, Xcode, Rust, LLVM | explicit form list | exact commands and `artifacts/acceptance/<commit>/` path | pass/fail/skip counts | pass/fail counts | pass/fail/skip counts; validation on | reviewer GitHub login or maintainer exception |
Do not write `pass` without counts. Do not count a skipped native test as Metal
evidence.
## Promotion and failures
After a passing entry, set the accepted rows to `fixture verified` and regenerate:
```sh
python3 scripts/audit/status.py
python3 scripts/audit/status.py --check
```
If any required check fails or skips, leave the form pending. Record the commit,
host, command and failure in the review log, and open a separate issue for the
failure. Do not weaken the test or change the expected result in the acceptance
pass.
The automated status-check enforcement proposed in #302 is a separate change.
Until it lands, reviewers must enforce the review-log requirement manually.
+3 -3
View File
@@ -10,7 +10,7 @@ import sys
import tomllib
registry = Path("docs/claims.toml")
claims = tomllib.loads(registry.read_text())["claim"]
claims = tomllib.loads(registry.read_text(encoding="utf-8"))["claim"]
classes = {}
errors = []
claim_id = re.compile(r"\bCLAIM-[A-Z0-9]+(?:-[A-Z0-9]+)*\b")
@@ -37,10 +37,10 @@ files = [Path("README.md"), Path("AGENTS.md"), *Path("docs").rglob("*"),
for source in files:
if source == registry or source.suffix not in {".md", ".toml", ".rs"}:
continue
for reference in set(claim_id.findall(source.read_text())) - classes.keys():
for reference in set(claim_id.findall(source.read_text(encoding="utf-8"))) - classes.keys():
errors.append(f"{source}: unregistered {reference}")
status = tomllib.loads(Path("docs/status.toml").read_text())
status = tomllib.loads(Path("docs/status.toml").read_text(encoding="utf-8"))
for feature in status["feature"]:
verification = feature.get("hardware_verification", "")
if verification.casefold() != "verified":
+6 -6
View File
@@ -18,7 +18,7 @@ def table(headers, rows):
def replace_block(path, name, body, check):
original = path.read_text()
original = path.read_text(encoding="utf-8")
start = f"<!-- status:{name}:start -->\n"
stop = f"\n<!-- status:{name}:end -->"
head, _, tail = original.partition(start)
@@ -30,7 +30,7 @@ def replace_block(path, name, body, check):
if check:
print(f"{path}: status table differs from docs/status.toml", file=sys.stderr)
return False
path.write_text(updated)
path.write_text(updated, encoding="utf-8", newline="\n")
return True
@@ -90,12 +90,12 @@ def render_progress(status):
def check_asset(path, svg, check):
if path.exists() and path.read_text() == svg:
if path.exists() and path.read_text(encoding="utf-8") == svg:
return True
if check:
print(f"{path}: progress graphic differs from docs/status.toml", file=sys.stderr)
return False
path.write_text(svg)
path.write_text(svg, encoding="utf-8", newline="\n")
return True
@@ -105,8 +105,8 @@ def main():
check = parser.parse_args().check
root = Path(__file__).resolve().parents[2]
docs = root / "docs"
status = tomllib.loads((docs / "status.toml").read_text())
claims = tomllib.loads((docs / "claims.toml").read_text())
status = tomllib.loads((docs / "status.toml").read_text(encoding="utf-8"))
claims = tomllib.loads((docs / "claims.toml").read_text(encoding="utf-8"))
classes = {claim["id"]: claim["class"] for claim in claims["claim"]}
features = table(
+5 -1
View File
@@ -8,6 +8,10 @@ export MTL_SHADER_VALIDATION=1
export MTL_SHADER_VALIDATION_REPORT_TO_STDERR=1
export MTL_SHADER_VALIDATION_ABORT_ON_FAULT=1
export CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS:-4}
# The full semantic-review batch is much larger than the individual GPU tests.
# Cold Apple Silicon runs can exceed two minutes; keep the default bounded but
# allow slower hosts to raise it without editing the script.
export XENORA_SEMANTIC_TIMEOUT=${XENORA_SEMANTIC_TIMEOUT:-300s}
cargo test --locked -p xenora-metal --features gpu-tests --test native_compute --no-run
timeout 30s cargo test --locked -p xenora-metal --features gpu-tests --test native_compute -- \
@@ -58,4 +62,4 @@ timeout 30s cargo test --locked -p xenora-ffi --features gpu-tests --test audio_
# Native Metal known answers of the independent semantic review, including SOP2 scalar ALU
# and VOPC compares.
cargo test --locked -p xenora-semantic-review --no-run
timeout 120s cargo test --locked -p xenora-semantic-review -- --ignored --nocapture --test-threads=1
timeout "$XENORA_SEMANTIC_TIMEOUT" cargo test --locked -p xenora-semantic-review -- --ignored --nocapture --test-threads=1