main translates all three (a59367f7, 524d1e92), but no fuzzer generated
them and --list-ops still called v_ldexp_f64 untranslated. 47 -> 50 forms.
- Reference: v_ldexp_f64 is the exact S0 * 2^S1 rounded once by
MODE.FP_ROUND[3:2] (subnormals kept, zeros/infinities/NaNs pass, toward
zero never rounds up and overflows to DBL_MAX); the integer conversions
are exact. Their clamp is judged: ldexp clamps with integer ops and an
integer is never NaN or -0.
- Generation: S1 aimed at the subnormal and overflow edges, S0 refilled
with subnormals, boundaries and all-ones low words (rounding carry), and
s_round_mode 0/12 before 30% of the ldexp cases.
- Known divergence ldexp-f64-mode: main ignores a toward-zero MODE write
in v_ldexp_f64 (#6218 fixes it); such results are counted skips, and the
--known probe (DBL_MAX * 2) mismatches until #6218 lands.
- tests/spirv_interp.py: OpConvertUToF/OpConvertSToF to %double are exact
(they rounded through binary32: v_cvt_f64_u32 0xffffffff read 2^32), and
SClamp, UClamp, FindUMsb, OpSLessThan and OpSGreaterThan exist, which
the integer-only ldexp lowering needs once a module has a %double op.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No fuzzer generated these five scalar ops. The SCC selects keep D when SCC is
0, read SCC without writing it, and join the --branches consumers. For the
relative reads a program sets M0 to 0..7 after the seeds, and each s_movrels
reads SGPR[S0 + M0] inside the seeded SGPRs; an odd M0 gives no b64 form (an
odd-aligned pair is unmeasured). Shrinking keeps the M0 line. The rows rest
on the gfx1035 cases of tools/int_hw_probe.py.
Five translator mutations (s_cmov_b32 ignores SCC, s_cmovk_i32 zero-extends,
s_cmov_b64 keeps the high word, s_movrels ignores M0, the b64 high word read
without M0) each fail a unit test and a 2,000-program run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After merging current main, CPU seeds 1-3 and `--programs 3000 --seed 9` reported
mismatches on v_frexp_mant_f64, v_frexp_exp_i32_f64, v_rsq_f64 and v_sqrt_f64 only,
for example `v_frexp_mant_f64 v[8:9], 0x3470fbc87309e9cc` (expected 7309e9cc 3fe0fbc8,
actual 00000000 3fe9e9cc), and `--oracle gpu --programs 300 --seed 1` also reported
v_rcp_f64 (the CPU run skips it: no OpFDiv in the interpreter). Main's translator now
reads the literal of those forms as the upper half of the f64 operand and takes only its
low 32 bits, which is the ISA rule for a 32-bit literal (measured on gfx1036); the
generator printed a full-width text literal for them. They now get 32-bit literals like
the rounding, add, compare and class forms, so the listings are also valid assembler
input for --oracle hw. v_div_fmas_f64 and v_div_fixup_f64 keep full-width literals:
v_div_fixup_f64 reads a printed 32-bit literal as the low word on main (a 32-bit literal
there mismatches the ISA rule; reported, not worked around).
Checked on origin/main 561b65a83: CPU seeds 1-5 and 7 clean, `--programs 3000 --seed 9`
2737 match / 0 mismatch, a 4000-program run of the affected forms (seed 11) 1980 match /
0 mismatch, and on the RTX 4070 `--oracle gpu` seed 1 (300 programs) 331 / 0 and
`--programs 1500 --seed 9` 1460 / 0. A test pins the literal width per form.
AI-assisted (OpenBot team).
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
GetCopyableFootprints started the layout at BaseOffset and aligned every
subresource to D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT as an absolute
address. The PC runtime lays the subresources out from 0 and adds the base
afterwards: with base 513 the host returns offset 513 for subresource 0,
ours returned 1024, and the totals differed by the gap.
GetCopyableFootprints1 wraps the same function.
compare_footprints now also runs bases 513 and 2^32 + 1 (both unaligned)
next to 0 and 1024. Against the hardware host device on an AMD Radeon
RX 7600, on main 561b65a8, the old code gives 652 mismatching fields
(offsets and totals), all at the two new bases: with only 0 and 1024 it
gives none, which is why this went unnoticed. With the fix there are none
at any base. No caller in the runtime passes an unaligned base (the only
internal caller is GetCopyableFootprints1).
AI-assisted. Tested on AMD Radeon RX 7600, driver 26.11.2 (LLPC),
Windows 10 22H2 (in-box d3d12core 10.0.19041), MSVC 14.44.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RSRC2 bit 10 adds an SGPR after the workgroup ids. The translator refused every compute
shader that sets it. None of the 2,689 carved CS does, but 91 compute programs of the
pipeline library in shaders.rpf do (docs/shader_library.md), and they read it as
s_and_b32 sN, sTG, 0xfc0, mostly followed by v_mbcnt_lo_u32_b32.
The prologue now writes it: waves in the group in [5:0], this wave's index in [11:6], 0
above. That is the GFX6-10 layout Mesa reads (ac_nir_lower_intrinsics_to_args.c:
load_num_subgroups = tg_size[5:0], load_subgroup_id = tg_size[11:6], wave64 local
invocation index = mbcnt(~0, tg_size & 0xfc0)). Thread i is in wave i / W, as for
s_get_waveid_in_workgroup. Not measured on hardware.
tests/semantic/test_cs_tg_size.py runs it on the CPU (local index through the 0xfc0 field
in wave32 and wave64, 1-D and 3-D groups, the wave count with a partial wave, the whole
value, the register after three workgroup ids). The two tests that pinned the refusal now
check that it translates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main 7de2d446 and 2c3cc2a8 measured them on gfx1036 and the translator now
accepts them: an output multiplier changes nothing on an f16 result while
clamp still acts, and on v_frexp_exp_i16_f16 clamp and the multiplier are
both no-ops. The self-test still pinned three of them as refused, so the PR
failed its own test once merged onto main.
The model applies the measured rules, min3/max3, frexp_mant, frexp_exp and
ldexp get a multiplier in the random stage, frexp_exp gets clamp, and the
self-test and tests pin the measured words. A translator mutant that applies
the multiplier on clamp_f16 results is caught by the sweep (80 programs) and
the random stage (21).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main 225f8266 measured both on gfx1036 and the translator now accepts them:
clamp is a no-op, and op_sel[2] = 1 writes S0's result to D[31:16] with
D[15:0] = 0, dropping S1's. The self-test still pinned them as refused, so
the PR failed its own test once merged onto main.
The reference models the destination bit, the sweep and the random stage
generate both forms, and the self-test pins the three measured words. Two new
translator mutations (destination op_sel ignored, clamp clamping to [0, 1])
are caught by the sweep and the random stage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v_min3/max3_f16, v_frexp_mant/exp_i16_f16, v_ldexp_f16, v_fmamk/fmaak_f16,
v_pk_fmac_f16 and v_fma_mix_f32/mixlo_f16/mixhi_f16 were in no --list-ops
and no generator. The tool compares the translation, run in
spirv_mini_interp, bit for bit with an exact-rational reference built from
the docs/design.md rows: a source-kind sweep, an edge grid with fma near
ties, random seeded programs, and --exhaustive-f16 for frexp/ldexp.
tests/test_f16misc_diff.py pins the reference to the gfx1036 words already
in tests/semantic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No fuzzer generated v_cvt_flr_i32_f32, v_cvt_rpi_i32_f32, v_cvt_norm_{i16,u16}_f16 or
v_cvt_pknorm_{i16,u16}_{f32,f16}. cvt_diff.py runs them with every source kind and modifier the
translator takes, and compares the translation (run in spirv_mini_interp) with a reference in
exact rationals, bit for bit. Stages: a source and modifier sweep, an edge grid that holds every
f16 near tie, seeded random programs, and --exhaustive-f16 over all 65,536 halves.
tests/test_cvt_diff.py pins the reference to the measured words and checks the generator and a
wrong-translation canary. docs/shader_validation.md gets a subsection with the results.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups on #4536.
abnalstlll-byte ran `--oracle hw` on a gfx1036 and got 1 mismatch ("word 1: expected
00000001 ffffffff, actual 00000001 00000001"). The hardware kernel runs one thread of a
wave32, so EXEC starts as 1: a v_cmpx result read back through exec_lo is 1 or 0 there,
while the translator and Vulkan oracles show the full 32-lane mask. The reference
assumed 32 lanes for every oracle. ref_program now takes the starting EXEC mask and
run_one passes HW_LANE_MASK (1) for --oracle hw; the other oracles keep 0xffffffff. A
fake one-lane machine reproduces the reported mismatch with the old assumption and
matches with the new one. Not confirmable here (no AMD GPU): that the same one-lane
reading is all that differs on the real device.
memorypressure noted that the constant-folded Fma zero-sign exclusion applies to every
--oracle gpu run while its reason and the doc named one vendor. The reason is now
vendor-neutral, the doc says it was observed on an NVIDIA RTX 4070 only, and a test
pins that --oracle hw never uses it.
AI-assisted (OpenBot team).
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
Gen.fma_exact (SHADER-497) had two inputs where it was not the single-rounded
f32 FMA it claims to be:
- A product of at least 2^126 takes the 2^-64 scaling, which turned an addend
with 0 < |z| < 2^-62 into 0 (or a denormal a flushing driver drops). When
x*y lies exactly on a rounding tie, z's sign is what breaks it, so
(1 + 2^-12)^2 * 2^126 + 2^-100 gave 0x7e801000 instead of 0x7e801001.
Such a z now becomes a signed 2^-126, as v_div_fmas_f32 does for its own
pre-scaling.
- Infinite operands take the plain Fma. On a driver that splits it, a finite
x*y beyond FLT_MAX rounds to an infinity first, and with z the other
infinity the result was a NaN. Finite x and y with an infinite z now give z.
--fma glsl and --fma khr translate as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The four programs that run every pixel, store, texture and sampler case of scripts/run_gpu_tests.py
built their instance without layers and ignored LEONIDA_VK_VALIDATION, and a validation message
never changed their exit code, so a validation run of the suite could not fail on them. Each now
takes the instance setup from runtime/test/vk_validation.h, like vk_compute_test (TEST-877): the
layer, VK_EXT_debug_utils and a messenger when the variable is set, and main ends through
OptInValidation::exit_status, so a counted validation error exits 1 with "N validation errors".
Without the variable nothing changes. docs/testing.md now lists every shader test program as
reading the variable, and drops the by-hand VK_INSTANCE_LAYERS recipe that only covered them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
origin/main already carries tools/f64_diff.py at 7bd5f01d plus two small maintainer
edits (the stdout reconfigure guard in tools/f64_diff.py, and the two --known tests
adapted to a translator that matches NaN(S0)). This branch drops div-fixup-nan-s0
from KNOWN_DIVERGENCES and rewrites those two tests, so the merge keeps this branch's
versions of them and main's stdout guard.
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
Review notes on #4717 (tupacfan04):
- "15 words" was 10 operand sets, each one word under three encodings, plus
5 op_sel rows; say that.
- Only v_dot4_i32_i8's clamp is measured on hardware; the other ops' clamp
comes from the ISA documentation, so a shared misreading would pass.
- The "8 sweep" row was op_sel_hi[0] ignored. Name it, and list what the
other variants fail on the same run (10, 13, 64 sweep programs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference kept a signalling NaN through mul:2 / mul:4 / div:2, while the
translator's OpFMul quiets it, so a later v_cmp_class_f32 differed (seed 202,
program 53: v_ldexp_f32 v5, -|v18|, v1 mul:2 with v18 = 0x7f800001, then a
class test on bit 0). What the hardware does is not measured, so the program
is now skipped as "output modifier on a signalling NaN", like the clamp of a
NaN. Quiet NaNs and sNaNs without an omod are judged as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The corpus switches f16/f64 rounding at run time (9,417 MODE writes), but no
fuzzer writes MODE, so the f16 fuzzers only run in nearest-even mode.
mode_diff.py mixes setreg 0/3 and s_round_mode 0x0/0xc with 19 mode-aware f16
ops and checks the exported words against an exact Fraction reference. It
also checks that the transcendentals, exact ops and f32 arithmetic give the
same words with and without their MODE writes.
Stacked on #5310: against main it reports v_ldexp_f16 overflowing to inf
under toward zero. Seeds 1-5: 2,532/2,532 judged programs match. Eight
planted translator bugs are each caught.
docs/design.md: v_fract_f16 is not exact for small negatives
(fract(-(2^-10 + 2^-20)) needs 20 bits); the translator already rounds it by
the mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After s_setreg_imm32_b32 hwreg(HW_REG_MODE, 2, 2), 3 every VALU f16 result
except the transcendentals rounds toward zero (docs/design.md), but the
v_ldexp_f16 branch never read %mode_r16: an overflow still gave +-inf
(0x7c00 for 0x7bff * 2, want 0x7bff) and a denormal result still rounded
to nearest even (0x3c03 * 2^-15 gave 0x0202, want 0x0201).
When the program writes the field, overflow now gives +-65504 and the
denormal rounding increment is dropped while the mode is 3. Programs that
never write MODE emit the same code as before.
tests/semantic/test_ldexp_f16_mode_round.py: edge cases, a seeded sweep
against an exact rational reference in both modes, and a check that every
f16 case of tools/mode_round_probe.py is the translator's word. The probe
gets two ldexp cases so an RDNA2 GPU can confirm the toward-zero words,
which are not measured on hardware.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With it, d3d12_xs reads list slot 48 as the console's IASetVertexBuffers, so the PC-shaped fixture list's
ClearRenderTargetView never runs and Close fails. The branch also changes runtime/src/pe_loader.cpp and carried
committed conflict markers in docs/fssm_crosscheck.md. Its docs rows go with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generated page was already out of step with this round's rows (test_design_contracts), and the PR also
changes AGENTS.md, the PR template, ci.yml and adds an agent skill. docs/design.md keeps its current rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No fuzzer generated v_movrels_b32, v_movreld_b32, v_movrelsd_b32, v_movrelsd_2_b32,
v_swaprel_b32 or v_swap_b32. vrel_diff runs seeded straight-line programs of them, with M0
and EXEC rewritten between them, through rdna2spirv and spirv_wave_interp and compares all 32
VGPRs of the window in every lane with a per-lane model of the RDNA2 ISA descriptions.
rdna2spirv raised Unsupported for v_movreld_b32 with an SGPR, M0, inline constant or literal
source. Only the destination is indexed, so the source is any VOP1 source (LLVM's
VOP_MOVRELD takes VSrc_b32; llvm-mc 21.1.8 accepts s4, m0, 7, -3, 1.0, a literal, e32 and e64).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since 70e739fd7 (coalesce hoisted spine guards) the tail program is one tail scheduler, so
test_tail_scheduler_after_a_mini_scheduler and the interpreter check of the mini scheduler's clears fail after the
merge, though they pass on the branch (based on aa2988cc).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coherent 1D and 3D loads and all 1D-array loads can issue OpImageRead on Unknown-format storage views. Require both per-format access bits before registering the view or writing its descriptor, while preserving the formatted RGB9E5 exception.
AI-assisted. Verified the synthetic UAV readback and format refusals with Vulkan validation on RTX 4090 (621.01) and UHD 770 (101.7088).
Register the descriptor smoke test with CTest and run synthetic dispatches against the real bindless set and WARP. Cover sliced-volume atomics, typed mip loads, and runner failure/skip handling; document the ABI, limits, and test procedure.
Reconstructs 6429d472, 8dc50af2, and the test and documentation resolutions through a56b8589.
The GFX10 constant-bus limit of v_lshlrev_b64, v_lshrrev_b64 and
v_ashrrev_i64 is one, not two: llvm-mc and COMGR reject
`v_lshrrev_b64 v[2:3], 0x12345678, s[4:5]` and `..., s4, s[6:7]`.
With an SGPR pair as S1 the generator now takes a VGPR or an inline
constant as the shift count, and the reference raises RefError on a
second scalar value.
The reference also ran `s_mov_b32 s4, 1 clamp` (and a v_cmp or
v_cndmask with clamp) because those return before the clamp check.
The check now comes first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The e64 forms of v_add/sub/subrev_co_u32 and v_add/sub/subrev_co_ci_u32
now get clamp on about a third of their lines. The reference saturates D
(0xffffffff on an add's carry, 0 on a sub's borrow) and still writes the
real carry or borrow to the mask, as measured on gfx1035 and gfx1036 in
the docs/design.md "Integer clamp" row. clamp on any other line is a
RefError.
One source of an e64 _co_ci_ line is now -1 one time in five: then the
carry (borrow) in alone decides the carry (borrow) out, the edge an
overflow test written as "result < source" misses. In the e64 form both
constant-bus slots hold masks, so before this only the inline constant
-1 (one value in 81) or a stray all-ones lane reached it.
Four new tests; a paragraph in docs/shader_validation.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2977 (merged this round) reads the literal by the SRC field; #3369 replaced any operand whose value matched
the literal's low half, so an inline constant printed as the same value took the literal
(test_fma_mix_literal's inline-constant case). The two PRs fix the same thing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The active-run check (#3549) accepted only stores through an inline %vgpr OpAccessChain, so with the register
pointers hoisted into %entry (#4440) every VGPR write in a run failed the assertion. #4402's test still expected
numeric ds_swizzle offsets to be refused; since #4177 (measured on gfx1036 for all 16,384 offsets) only
0xC000..0xFFFF is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No fuzzer generated v_add_nc_i32 / v_sub_nc_i32 or v_lshlrev_b64 /
v_lshrrev_b64 / v_ashrrev_i64, and none put clamp on the unsigned
add/sub with a literal. vint_diff now generates:
- clamp on the e64 / VOP3 form of v_add_nc_u32, v_sub_nc_u32,
v_subrev_nc_u32 (saturate to [0, 0xffffffff]) and v_add_nc_i32,
v_sub_nc_i32 (saturate to [0x80000000, 0x7fffffff]), from the
measured "Integer clamp" row of docs/design.md;
- the three 64-bit shifts into a VGPR pair, S1 a VGPR pair (odd first
registers included), an SGPR pair or an integer inline constant
sign-extended to 64 bits. A literal or a float inline constant as S1
is left out: its widening is not measured.
The destination parser, the observed registers and the shrinker's seed
filter now understand register pairs. Six new tests; a paragraph in
docs/shader_validation.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collects the marked notes of runtime/src, runtime/shims and docs/*.md with file
and line, each from its marker to the end of its comment run or list item
(trailing 'see the header' comments are left out). Given gdk_runtime_calls'
JSON, a shim's notes are marked called / not called by whether the executable
calls a class that file serves, called first. first_look.ps1 writes
reports/exe/<name>/checklist.md. tests/test_exe_checklist.py: 6 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XDisplayTryEnableHdrMode answers Disabled for the SDR host output, or Enabled
with the documented default tone-map luminances under LEONIDA_HDR=1. Every
device belongs to the offline user (XUserFindForDevice hands out a real
XUserHandle via xgameruntime_user.cpp); association and audio-endpoint
registrations hand out tokens; no audio endpoint of the user's own; finding a
controller shows no UI and gives an all-zero id, as on desktop.
ctest 163/163 (xgameruntime_offline twice: SDR and LEONIDA_HDR=1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XGameEventWrite succeeds and drops the event (LEONIDA_LOG_GAME_EVENTS=1 logs
them). A message or error dialog has no screen: its title, text and buttons go
to the log and it completes with the default button, so an error the game
shows at boot is readable. Other UIs fail before starting. Streaming: never
streamed, no clients, a connection-state token that never fires; per-client
slots answer E_GAMESTREAMING_NOT_INITIALIZED, whose low byte reads false for a
bool caller. Ids and slot order from xgameruntime-docs, signatures from the
GDK reference; two parameter lists marked ASSUMPTION.
xgameruntime_offline_test: 18 checks. ctest 162/162.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reviewer's `--oracle gpu --ops v_div_fmas_f64 --programs 300 --seed 1` run had one
mismatch: `v_div_fmas_f64 v[8:9], 16, 0xa5126aa7ea6efc1f, 0` (VCC clear), reference -0,
GPU +0. Diagnosis (RTX 4070):
- IEEE is -0: the exact result is a negative nonzero that underflows, and the C library
fma and the reference agree. Denormal operands are preserved by the GPU, so it is not
operand flush-to-zero.
- The translator emits a plain GLSL `Fma` for that path (SPIR-V checked), and adding
SignedZeroInfNanPreserve/DenormPreserve 64 does not change the GPU result.
- The same `Fma(2^-600, -2^-600, +0)` on runtime operands (a FragCoord-derived shader)
returns -0 on the GPU. Only an all-constant `Fma` loses the zero sign, which points at
the driver folding it. The fuzz shaders are all constants.
So neither the reference nor the translator is wrong. A GPU result that differs from
the reference only in the sign of such a zero (an underflowing Fma against an
opposite-signed zero addend) is now a counted skip with that reason; any other
difference still fails. ref_program reports the case through an optional notes list.
Tests pin the flag, the skip, and that a flip without the underflow, or with another
differing word, stays a mismatch (four mutations fail them). docs/shader_validation.md
records the diagnosis.
AI-assisted (OpenBot team).
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
A GDK title checks its license at boot. QueryApiImpl now serves XStoreImpl
(IXStoreImpl..6, 84 slots from xgameruntime-docs' layout; signatures from
the public GDK reference): the game license is active and not a trial,
package licenses are acquirable and valid, no add-ons, no products, no
package updates; license-changed/lost registrations hand out tokens and
never fire. Purchases, consumables, tokens, downloads and store UIs fail
before starting (E_FAIL, logged once); the undocumented slots answer
E_NOTIMPL.
UNVERIFIED: STORE_SKU_ID_SIZE 18, SKU_ID_SIZE 5, TRIAL_UNIQUE_ID_MAX_SIZE
64 (XStoreGameLicense 104 bytes) - the public pages give no values; to be
confirmed against the executable before a boot relies on them.
xgameruntime_store_test: 22 checks. ctest 161/161.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for #4348 (Flyander, AirKyzzZ):
- DSTORAGE_REQUEST allows a buffer over 32 MiB only with 64 KiB or 2 MiB
pages, which are not implemented yet, so such a request now fails with
E_DSTORAGE_REQUEST_TOO_LARGE before any memory is touched.
- TotalRequestCount and the byte totals grow when a request is submitted,
not when it is enqueued, and PendingRequestCount counts the request the
worker is processing (DSTORAGE_PRIORITY_STATS).
- dstorage.cpp is built with /EHa under clang-cl, so guarded_move's __try
catches an access violation in a title's buffer there too.
Tests: an over-limit and an at-limit 32 MiB copy, and stats checked
before Submit and while a copy is held on a guard page. The three new
failing checks fail with the previous shim.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A GDK title opens its save provider at boot; QueryApiImpl now serves
XGameSaveImpl (IXGameSaveImpl..3, 33 slots from xgameruntime-docs' layout,
signatures and error codes from the public GDK reference). Saves are files
in LEONIDA_SAVE_DIR\local-user\<container>\<blob> (default
%LOCALAPPDATA%\Leonida\saves), %-encoded: the layout tools/saves.py import
already writes. Updates are buffered and committed by write-then-rename;
container names follow the documented rule; the 16 MB update limit, the
documented E_GS_* codes, async variants through XAsync, and the
XGameSaveFiles folder/quota slots. Assumptions (quota, blob-name length,
nullptr blob list) are marked in the source and docs.
xgameruntime_gamesave_test drives every slot (50 checks). The two tests that
used XGameSaveImpl's id as "a class not served" now use a made-up id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found while validating the #2477 follow-up on the RTX 4070: with the current
translator, `v_cmp_eq_i32_e32 vcc_lo, 0, 0; v_div_fmas_f64 v[8:9], s[4:5], -1.0, 1`
mismatched. The reference scaled by a fixed 2^64 when VCC is set; main now follows the
hardware-verified (gfx1036, 153/153 f64 stress cases) rule in the docs/design.md
v_div_fmas row: 2^+128 when exp(S2) > 1023 (|S2| >= 2.0), 2^-128 otherwise.
Same class of stale reference as the v_div_fixup_f64 one fixed in the previous
commit (TreXito's review of #4536). A table test pins both sides of the |S2| = 2.0
threshold and the VCC-clear case; reverting to the fixed 2^64 fails it.
AI-assisted (OpenBot team).
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>