Repository navigation
Conversation
It was untranslated (the isa_coverage census listed it as missing). The common use is reading the current round mode, hwreg(MODE, 0, 4). XCL already models MODE[3:0]: [1:0] (f32) is always 0, as any other value is refused, and [3:2] (f16 / f64) is xcl_fp16_rm where a program changes it. A read of a field within MODE[3:0] is therefore exact. MODE[3:2] is now also followed at run time when the program reads it back, not only when an f16 op rounds by it: a change of it in a program without f16 ops was dropped before. Other registers and MODE bits depend on the console's hardware and program set-up (HW_ID1 / HW_ID2, STATUS, SHADER_CYCLES, denormal and clamp bits): refused, naming the register, instead of a made-up value. Tests: the HLSL for constant and followed MODE reads and the refusals, and a GPU test reading MODE around s_round_mode / s_setreg_imm32_b32 in a program without f16 ops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ufoptg
pushed a commit
that referenced
this pull request
Nov 24, 2026
…the switch form NVIDIA 616.92 (RTX 5070 Ti, reported in #156) refuses some big programs whose descriptor-heap index depends on the memory window with E_OUTOFMEMORY, and builds the same programs in the switch form. A translated compute, graphics, mesh or GS pipeline whose driver call fails that way with heap windows is now translated again in the switch form (other cache keys; same root signature and binds) and built from that before the stand-in or the error path. Test: heap_window_out_of_memory_falls_back_to_the_switch_form injects the refusals through the CreateComputePipelineState hook, then dispatches the rebuilt pipeline and checks every thread's output. From #187 by Remington Wilcox (41d4506). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#938 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
s_getreg_b32was untranslated (theisa_coveragecensus lists it as missing; no open PR or issue covers it). It reads a field of a hardware register into an SGPR. The common use in compiled shaders is reading the current round mode (hwreg(HW_REG_MODE, 0, 4), what LLVM'sllvm.get.roundingbecomes), often to restore it later.XCL already models MODE's round modes:
[1:0](f32) is always 0, since any other value is refused, and[3:2](f16 / f64) isxcl_fp16_rmwhere a program changes it. So a read of a field insideMODE[3:0]is exact. The rest is refused, with a reason that names the register (which then shows inreport.json), not answered with 0: the other MODE bits (denormals, clamps, IEEE) come from the console's program set-up, and registers such asHW_ID1/HW_ID2(wave, SIMD, CU ids),STATUSorSHADER_CYCLESfrom its hardware. A made-up value would be wrong for some programs, e.g. two waves with the same wave id indexing per-wave slots.What is in it
crates/xcl/src/gpu/recomp/emit.rs:getregfors_getreg_b32(MODE fields within[3:0]; refusals for the rest, named).configure_round_modesalso followsMODE[3:2]at run time when the program reads it back, not only when an f16 op rounds by it: before, a change of it in a program without f16 ops was dropped, and a read would have given 0.crates/xcl/src/gpu/recomp/tests.rs:s_getreg_b32_reads_the_round_modes_and_refuses_the_rest(the HLSL for a constant and a followed MODE, and the refusals with their reasons) andgpu_s_getreg_b32_round_modes(MODE read before and afters_round_modeands_setreg_imm32_b32, in a program with no f16 op:0,0xC, single bits, a field straddling[1:0]/[3:2]). Without theconfigure_round_modeschange the GPU test fails (every read gives 0).Tested
stable-x86_64-pc-windows-msvc, debug, DXC 1.9.2602.17cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 715 passed, 3 failed, 41 ignored. The 3 aremain's memory-pressure failures of Memory: a sparse alloc/free loop makes a new 64 MiB pool each cycle; lib tests fill a 12 GB card (#348's test) xcl-dev/xcl#913 (placed_title_textures_share_vram_and_preserve_pixels, thentransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memoryon its poisoned lock), which D3D12.X: a sparse pool retired a moment ago is taken back (#913) xcl-dev/xcl#923 addressescargo test -p xcl --lib -- --test-threads=4 --skip a_freed_block_is_decommitted_before_its_address_is_reused: 676 passed, 0 failed, 21 ignoredgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware; noXCL_SAMPLE_*setisa_coveragestill listss_getreg_b32: it encodes each instruction with zero operands, which for this one is hardware register 0, refused on purposeRegression run
main:This PR:
Not tested
s_setreg_b32 hwreg(MODE, 0, 4), sNfrom an SGPR is still refused (dynamic f32 round mode), as before this changeAI use
🤖 Generated with Claude Code
Mirror of xcl-dev#938 (auto-synced, do not edit).