Skip to content

feat(qemu): align Tile execution with PTO 0.58.6 - #80

Merged
zhoubot merged 39 commits into
masterfrom
codex/pto-0586-qemu
Sep 5, 2026
Merged

zhoubot merged 39 commits into
masterfrom
codex/pto-0586-qemu

Conversation

@zhoubot

@zhoubot zhoubot commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

PTO 0.58.6 reassigns TLSU functions 9–28, retires legacy direct Tile selectors, narrows Shared IDs to S0–S63, and requires exact ELF identity. This PR supersedes #66 and #79 with one QEMU line that decodes the 773-form LinxISA catalog, rejects retired aliases, executes the integer GM atom/reduction subset with full address preflight and atomic CAS, and implements the direct Local TIMG2COL M16/M32 path.

Unsupported accepted subprofiles fail closed: floating GM ADD, packed GM indices, nonzero GM atom destination padding, IOMMU-translated GM atomics, and cooperative Shared TIMG2COL. The QEMU support document records these boundaries.

Validation:

  • fresh qemu-system-linx64 build
  • 87 PTO v0.58 source-contract tests
  • strict opcode metadata sync: 0 mismatches
  • ISA coverage: 744/744 mnemonics, 773/773 forms
  • AVS Tile suites: TLSU, VEC, SFU, CUBE, GM atom/reduction, and TIMG2COL PASS using LLVM 3d79447f635b00feb68f5a6acaa2dae31dc43b7a
  • independent agent review: PASS on commit tree 3e939897aeeabbd9ade9b1e559b8fa3396d55656

jiale-wangOwO and others added 30 commits August 23, 2026 22:55
Rewrite linx_tile_sort to match the authoritative TSORT.asl ordering and
publication model: sort_width from LB0 (0/omitted = 32, 1..64), stable
per-row-group 64-pass adjacent swaps, numeric-before-NaN ordering in both
directions, NaN source-order stability, signed-zero equality, and per-dtype
NaN classification (FP16 0x7c00/0x0200, BF16 0x7f80/0x0040, FP32
0x7f800000/0x00400000). The U32 index output is the original zero-based
column offset within its group (col MOD sort_width), and its physical rows
derive from its own 4-byte element size and TSize capacity. Signaling-NaN
observation ORs the sticky invalid status instead of faulting. Restrict the
TSORT dtype gate to FP32/FP16/BF16.
- TDEQUANT: read the integer source type from tile_dtype (B.DATR carries the
  FP32 destination type), accept S8/U8/S32 integer sources via a variable
  source array, and free TSize from the destination descriptor.
- TQUANT: implement affine FP32 -> S8/U8 quantization with optional B.IOR
  scale/zero-point (omission selects multiplier 1.0 and zero point 0).
- TREMS/remainder: support FP16/BF16 remainder binary operations and relax
  the nonzero-divisor preflight for those dtypes.
- Add E8M0 and low-precision numeric encode/decode to the f32<->dtype helpers
  (type 6..14), including ReferenceFloatToE8M0 rounding modes.
- MSCATTER / MSCATTER_MASK: accept source-only TSize=000 and derive
  capacity/size_code from the source descriptor; use the active valid extent
  for bounds checks.
- MGATHER.CAS: use the active valid extent for offset and expected/desired
  tile validation.
- Bind operation sources through linx_tile_operation_source_count_accepted
  so variable-arity operations are permitted.
- TINSERT double-source fix and TQUANT optional-IOR preflight.

Refs: LinxISA/SuperScalarModel#132
Restore the Core-level aggregate Shared B.IOS payload semantics from the
feat/tsort-v058-contracts branch on top of the PTO 0.58.3 master base.
This keeps the legacy whole-payload path (issue #112/#132) while wiring
the local/Shared TMOV preflight and commit paths to the new 0.58.3
registers and binding fields.

The 0.58.3 per-PE Shared layout is replaced by the aggregate form:
- local_to_shared writes the PE quarter into a Core-level payload.
- shared_to_local reads the PE quarter (or the whole payload) back out.

Validation:
- ninja -C build-linx qemu-system-linx64
- python3 tests/linxisa/test_v0583_contract.py
- python3 tests/linxisa/test_v058_pto_contract.py
The 0.58.3 master tests expected the per-PE Shared layout. On the branch
we keep the aggregate Core-level payload (issue #112/#132), so update the
contract assertions to require the legacy_whole path and the aggregate
memcpy forms instead of the per-element region loop.

Validation:
- python3 tests/linxisa/test_v0583_contract.py
- python3 tests/linxisa/test_v058_pto_contract.py
Regenerate the QEMU tile profile workbook from the SuperScalarModel status
whose CUBE profiles are partitioned by ASL numeric class (Float->F32,
Signed->S32, Unsigned->U32, plus MX no-scale/with-scale).
Regenerate the QEMU CUBE profile matrix after the SuperScalarModel
cross-model status promoted the ordinary TMATMUL Local Float/Unsigned
class profiles on gfrun.  QEMU stays UNVERIFIED for those two classes
because the current QEMU CUBE path cannot execute any v058 CUBE block.
@zhoubot
zhoubot merged commit bfd46ef into master Sep 5, 2026
@zhoubot
zhoubot deleted the codex/pto-0586-qemu branch September 5, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants