perf(vk): big ASTC textures go to BC3 through a texel buffer and Longshot's own encoder, uploads grouped, decoder specialized #2909
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2909
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:perf/astc-bc3-two-steps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When the GPU keeps a big ASTC texture as BC3, main decodes it into an RGBA8 scratch image, then Eden's encoder turns the image into BC3. That costs three full barriers per run of layers (decode, encode, copy). This PR adds a faster path and makes the decoder cheaper. It is three commits:
perf(vk): the GPU ASTC decoder is specialized a footprint. The decoder's block footprint becomes specialization constants 1 and 2, so the driver unrolls the texel loops and folds the weight-grid steps.astc_readybuilds 14 pipelines, one per footprint, before the game. A footprint whose pipeline is refused uses the push-constant one, as before. Kill switch:RX_VK_ASTC_SPEC=0.perf(vk): big ASTC textures go to BC3 through a texel buffer and Longshot's own encoder, a recording's uploads grouped:ASTC_TO_TEXELS, writes texels into a 16 MB buffer.bc3_from_texels.comp, a new encoder written here, encodes them into a 16 MB output buffer, and that buffer is copied into the texture.RX_VK_ASTC_BC_ROWS).RX_VK_ASTC_BC_TEXELS=0goes back to the RGBA8 scratch and Eden's encoder, which BC7 and the AMD-resized textures still use either way.RX_VK_ASTC_BC_GROUP=0flushes after each texture.perf(vk): the ASTC decoder's texel weights are unquantized from a table. A 143-entry table replaces the per-weight arithmetic. It is bit-exact and speeds up both routes' decode.Read first:
bc3_from_texels.comp; invk_texture.cpp,bc3t_ready,bc3_group_flushandupload_texel_route.Not done, with the reasons:
Testing
Tested:
tests/test_astc_decoder_gpu.py --device llvmpipe, which runs its GPU check twice: through the push-constant pipeline, then through the specialized pipelines (--spec).test_astc_upload_chunking,test_texture_staging_publication,test_bc_*,test_builtin_compute_unoptimized,test_switches_removed,test_doc_anchorsandscripts/shaders.py host --checkpass. The renderer compiles (dev.py vk).mise run test(one build-mode queue job): 867 passed, 10 skipped, 46 failed. The same 46 fail on clean main4908cc6don this PC, so none is this PR's. CI's game-free checks run on the head as well.tests/test_bc3_group_flush.pypasses.Still to test:
vk: big ASTC textures go to BC3 by the texel routein the log (@Beanstalk)Measurements
Verdict: this PR's claim is the GPU time of the ASTC→BC3 conversion, main
4908cc6dagainst this PRff79b9ed(built on that same main):In-game fps and hitches are within run-to-run noise: no fps gain is claimed, and none is lost.
Game-free bench: GPU time of one conversion (timestamps; decode, barrier, encode in one submission; median of 9). The bench is a scratch harness built on the decoder fixture and is not committed. Main = the RGBA8 image route with main's decoder; this PR = the texel route with the specialized decoder and the weight table.
--mode timingqueue job; the RX 580 numbers from one lab.lock batch.BC3 quality, PSNR against texdecode's decode of the fixture's blocks, lavapipe (texel route / Eden's encoder, dB):
All 14 footprints are in the fixture's output.
In-game, RX 580 lab (Linux, RADV Mesa 26.2.6, 1080p internal, uncapped, V-Sync off, no upscaler). Main
4908cc6dis the warmstalls-mainbuild. This PR's renderer (59ed2156, identical in effect to this head) is swapped into a reflink copy of it. The route is Market → Hyrule Field, 2 laps; 2 interleaved pairs, plus one pass-timing run each. Zero crashes, upload failures or device losses in all 7 runs.The field gap above came from the game folders, not the route. The PR's folder had just had its renderer swapped, which resets its pipeline caches, and it got one 20-second warm-up lap. An in-build A/B settles it: the same build and folder, with the switches flipped, 2 rounds of four runs (a, b, c, d in that order), 2 laps each.
RX_VK_ASTC_BC_TEXELS=0(main's route)RX_VK_ASTC_BC_GROUP=0RX_VK_ASTC_SPEC=0Reading:
SPEC=0(d) measured as well as the default here. It ran last in each round, so its warmer start may count. The bench's 1–3 % gain from specialization is below this route's run-to-run noise.Crash found and fixed by these runs: an RGBA8 ASTC upload's chunk flush ended the upload command buffer while a BC3 group was pending, and the next BC3 upload recorded the group into the ended buffer (RADV null read; the validation layer names
vkCmd*-commandBuffer-recording).replay_flush_uploadnow flushes the group before anything else, andtests/test_bc3_group_flush.pyholds that in place.Risks
RX_VK_ASTC_BC_TEXELS=0restores the old route, andRX_VK_ASTC_BC_GROUP=0restores per-texture recording.upload_cmd(). The draws read textures only after the recording's closing barrier.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (867 passed, 46 failed; all 46 fail the same way on clean main4908cc6don this PC, among them test_switch_table, test_guest_holes, test_lifter and test_crt_options)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.ff79b9ed: Host C for Windows and the Windows/Linux renderer builds pass)mainand here, for a change that shows on screen. (compared, not attached: the lab's images stay local)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: RX 580 8 GB / RADV Mesa 26.2.6 / Linux (the AMD lab): main
28cb22b9, #2473 rebased and this branch, 2 interleaved 1-lap runs each plus a pass-timing run (Market, back into Hyrule Field, 60 s walk). Clean exits, no upload failed, device loss or validation line; the Market and field screenshots match main by eye.9b3022a3e11988922f57WIP: perf(vk): big ASTC textures go to BC3 in two steps by default, with a leaner encode half (depends on #2473)to WIP: perf(vk): big ASTC textures go to BC3 in two steps by default, with a leaner, specialized encode path and grouped uploads@beanstalk
Beanstalk test farm · an earlier run: commit
1988922(the newer results are in a comment below)Commit
1988922· approved by HumanBean (reviewed) · dashboard⚠️ Note: The farm cannot run the requested standalone texture benchmark or isolate per-texture ASTC conversion spans, so the reported GPU time and entry hitches do not directly establish the claimed conversion speed-up.
⚠️ Note: The default and one-pass routes are compared within the PR, but specialization and grouping kill switches are not isolated within the time budget; two starts per side are the minimum for comparison.
⚠️ Note: Stationary screenshot comparisons cover the two teleport views, not every texture footprint or the moving route.
Started at 03:36 UTC.
Estimate: done in about 35 min, from the queue and the testers online now; some jobs can't start yet.
⚠ No tester has a PC for
linux+nvidia+gpu-rtx-3090(none seen in 14 days): it waits until one signs in.nvidiaamdintelsteamdecklinux+radvwindows+amdwindows+amd+gpu-860m(GPU "860m")linux+nvidia+gpu-rtx-3090(GPU "rtx 3090")market-field-uploads· frame time p99 (ms)RX_VK_ASTC_BC_SPLIT=RX_VK_ASTC_BC_SPLIT=0(reference)nvidiaamdintelsteamdecklinux+radvwindows+amdwindows+amd+gpu-860m(GPU "860m")linux+nvidia+gpu-rtx-3090(GPU "rtx 3090")Why it failed
linux+radv:market-field-uploads · RX_VK_ASTC_BC_SPLIT= (PR only)screenshot.max_diff:0.1 → 0.8; limit 0.2windows+amd:market-field-uploads · RX_VK_ASTC_BC_SPLIT=0 (PR only)field.frametime_p99_ms.max_delta_pct:11.1 → 13.7 (+23.2%); limit 20.0Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.
amd, report 1:Insufficient frame-time evidence for 2 required comparison(s). See rule results.What was tested
What will be tested · AI plan (
gpt-6.1-terra)The farm will compare the default two-step ASTC conversion with the PR's one-pass route and with main in the Market and Hyrule Field, using two starts per side and 20-second measurements at each location. It will measure frame times, GPU time, load times and entry hitches, and compare stationary pictures for texture changes. Crashes, upload or device-loss errors, substantial timing regressions or excessive picture differences fail the plan. The Windows Radeon 860M target has no matching GPU listed online and will wait for a tester. No tester online now matches windows+amd+gpu-860m, linux+nvidia+gpu-rtx-3090: those targets wait for one.
0(PR only).market-entrance(settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switchesHOS_OUTPUT_RES=gpu,RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 20 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 10 s warm-up), move the stick; 2 runs on each side for each of 2 cells (2 game starts a run).Measurements on `amd`, for the PR description
Verdict: pass on amd (2 reports): no rule failed and no PR run crashed.
Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAMScene: market-field-uploads, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=gpu, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-field-uploads: 2 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)0863eff1988922RX_VK_ASTC_BC_SPLIT= (PR only)· field · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· market · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· longest load (s)RX_VK_ASTC_BC_SPLIT= (PR only)· field · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· market · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· forbidden log linesRX_VK_ASTC_BC_SPLIT= (PR only)· worst frame time in the whole run (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· field · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT= (PR only)· market · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· longest load (s)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· forbidden log linesRX_VK_ASTC_BC_SPLIT=0 (PR only)· worst frame time in the whole run (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · peak VRAM (MB)Flags and settings
RX_VK_ASTC_BC_SPLIT0As Markdown for the PR description:
Measurements on `linux+radv`, for the PR description
Verdict: fail on linux+radv (2 reports):
market-field-uploads screenshot.max_difffailed.Hardware: 1: linux+amd+radv+igpu
AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM; 2: linux+amd+radv+dgpuAMD Radeon RX 580 Series (RADV POLARIS10), 26.3.1AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAMScene: market-field-uploads, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=gpu, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-field-uploads: 2 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)0863eff1988922RX_VK_ASTC_BC_SPLIT= (PR only)· field · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· market · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· longest load (s)RX_VK_ASTC_BC_SPLIT= (PR only)· field · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· market · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· forbidden log linesRX_VK_ASTC_BC_SPLIT= (PR only)· worst frame time in the whole run (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· field · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT= (PR only)· market · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· longest load (s)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· forbidden log linesRX_VK_ASTC_BC_SPLIT=0 (PR only)· worst frame time in the whole run (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · peak VRAM (MB)Flags and settings
RX_VK_ASTC_BC_SPLIT0As Markdown for the PR description:
Measurements on `windows+amd`, for the PR description
Verdict: fail on windows+amd (1 report):
market-field-uploads field.frametime_p99_ms.max_delta_pct (+23.2%)failed.Hardware: 1: windows+amd+amd-proprietary+dgpu+fsr4
AMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAMScene: market-field-uploads, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=gpu, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); market-field-uploads: 2 game starts a side, market 20 s after 10 s warm-up, field 20 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)0863eff1988922RX_VK_ASTC_BC_SPLIT= (PR only)· field · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· market · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· longest load (s)RX_VK_ASTC_BC_SPLIT= (PR only)· field · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· market · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· forbidden log linesRX_VK_ASTC_BC_SPLIT= (PR only)· worst frame time in the whole run (ms)RX_VK_ASTC_BC_SPLIT= (PR only)· field · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT= (PR only)· market · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · GPU time a frame (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· longest load (s)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · frame time (p99) (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· forbidden log linesRX_VK_ASTC_BC_SPLIT=0 (PR only)· worst frame time in the whole run (ms)RX_VK_ASTC_BC_SPLIT=0 (PR only)· field · peak VRAM (MB)RX_VK_ASTC_BC_SPLIT=0 (PR only)· market · peak VRAM (MB)Flags and settings
RX_VK_ASTC_BC_SPLIT0As Markdown for the PR description:
The testers' hardware
amdAMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAMamdAMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAMlinux+radvAMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAMlinux+radvAMD Radeon RX 580 Series (RADV POLARIS10), 26.3.1AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAMwindows+amdAMD Radeon RX 9070 XT, 2.0.416AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM@review
Recommendation: Approve. The upload fixture inherits switches that can disable the grouping it is meant to check. The current head’s in-game benefit and its effects on supported hardware and startup also remain unmeasured. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change replaces the existing ASTC-to-BC3 conversion path, defaults to a two-step converter, specializes its decoder and groups uploads. Earlier RX 580 game runs show shorter conversion spans, but the added pipelines, buffer and changed upload ordering carry startup, memory and compatibility costs that have not yet been measured on the current head.
Should fix (1): not blocking, but worth doing before merging.
tests/test_astc_upload_gpu.py:152: The GPU fixture inherits the caller’s renderer switches, so it can silently run with the behavior under test disabled. (more on the line) Do: Run the fixture and its hazard probe with renderer switches removed from their environment, then set only the values required by each explicit test case.Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_texture.cpp:1125: The current head’s grouping and specialization have not been measured in the game against main. (more on the line) Do: Run the planned interleaved game comparison against the merge base, including frame times and ASTC spans, and compare grouping on and off.gpu/vk/device_policy.h:829: The new default conversion route and upload ordering need coverage on the supported hardware they affect. (more on the line) Do: Run the stated game and conversion checks on the affected Tier 1 Windows and Linux hardware, including Steam Deck, and record output and frame-time results.gpu/vk/vk_texture.cpp:1006: The startup and cache cost of creating 14 additional decoder pipelines is not measured. (more on the line) Do: Compare cold and warm startup time and pipeline-cache size against main on representative supported hardware. (@fixdoes its part first: Create only the specialized pipelines actually needed, or defer their creation without blocking play.)@fixcan do L1 and L4.Checks: Failing on this head, which is behind its base, where they pass:
CI / Third-party parts and guide screenshots (pull_request),CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 1/2) (pull_request),CI / Game-free checks (run_all.py, part 2/2) (pull_request).@rebase(or@fix) brings it up to date and runs them again; not held against it.More: does it help, other systems, switches, what was read
Does it help: Unproven for the current head. Earlier RX 580 runs report 1,134 ms on main versus 994 ms for all ASTC spans in one pass-timing run; the current head’s synthetic bench reports 4–7% faster conversions than the preceding head on that GPU. Its in-game comparison against main is pending, and the grouping benefit is not measured by the single-texture bench.
Other systems: The conversion affects BC3 textures, upload synchronization, GPU memory and pipeline creation on both Windows and Linux. RX 580 Linux game runs and synthetic RX 580 and RTX 3090 measurements are reported; Windows, RDNA discrete GPUs, Intel and Steam Deck remain untested. The RGBA8 route and copies into BC3 also share parts of the changed upload machinery.
Switches: RX_VK_ASTC_BC_SPLIT defaults to 1, with 0 selecting one pass and 2 the cheaper two-step encoder. RX_VK_ASTC_SPEC and RX_VK_ASTC_BC_GROUP default on and accept 0 as kill switches. Their defaults are not yet supported by measurements across the affected platforms. RX_VK_UNEVEN_BC and RX_VK_UNEVEN_RGBA8 retain their defaults but change behavior when the uneven-level workaround is enabled. RX_VK_ASTC_BC7, RX_VK_BC_IDLE_S, RX_VK_BC_LAYERS, RX_VK_BC_LEVELS, RX_VK_BC_POOL and RX_VK_BC_SMALL_LAYERS are removed with GONE rows.
Reviewed:
1988922f57against0863effaf5: Read the supplied PR description, comments and CI results, repository rules, template, standards, commit log, and the principal conversion and upload code and fixture wrapper. Skimmed the remaining diff and generated shader headers; did not read every changed file in full. docs/review-checklist.md was absent.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no code, tests or project scripts were run. The author reports game-free fixture results and earlier RX 580 game runs.
Overlaps and merge order: #2473 contains the six carried commits. If it merges first, remove the duplicate commits and recheck the resulting diff and measurements.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -821,3 +827,3 @@p.replay_queue_priority = policy_rule::replay_queue_priority(f.game_queue_low, f.windows, f.driver_id, f.framegen);p.pcache_small_pc = !f.windows && f.driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY && (f.ram >> 20) && (f.ram >> 20) <= 20480;p.bc_small_runs = f.radv() || f.driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY || f.amd_win();p.astc_bc_split = 1; // (the two steps on every PC: faster than the one pass on every GPU measured)L3 (should fix): The new default conversion route and upload ordering need coverage on the supported hardware they affect.
When: Windows drivers, RDNA discrete GPUs and Steam Deck have not run the current path; the reported Linux RX 580 run cannot establish their output or frame pacing.
Do: Run the stated game and conversion checks on the affected Tier 1 Windows and Linux hardware, including Steam Deck, and record output and frame-time results.
@ -1152,0 +1003,4 @@} else {const char* spec_env = getenv("RX_VK_ASTC_SPEC");uint32_t made = 0;if (!(spec_env && env_value_off(spec_env))) {L4 (should fix): The startup and cache cost of creating 14 additional decoder pipelines is not measured.
When: A player with a cold pipeline cache must create the specialized pipelines before play, while the reported measurements cover conversion time rather than cold and warm startup or cache size.
Do: Compare cold and warm startup time and pipeline-cache size against main on representative supported hardware.
@ -1276,2 +1124,2 @@if (bc_small_layer_u[k]) ds.views.push_back(bc_small_layer_u[k]);bc_small_layer[k] = bc_small_layer_u[k] = VK_NULL_HANDLE;void bc3_group_flush() {L2 (should fix): The current head’s grouping and specialization have not been measured in the game against main.
When: The reported game runs predate these changes, while the newer bench uploads only one texture per recording and therefore cannot measure grouping or its effect on frame pacing.
Do: Run the planned interleaved game comparison against the merge base, including frame times and ASTC spans, and compare grouping on and off.
@ -0,0 +149,4 @@print(probe.stdout, end="")returnprint(probe.stdout[-2000:] + probe.stderr[-2000:])raise SystemExit("FAIL: synchronization validation did not report a missing barrier after a dispatch: its checks would be hollow")L1 (should fix): The GPU fixture inherits the caller’s renderer switches, so it can silently run with the behavior under test disabled.
When: With RX_VK_ASTC_BC_GROUP=0 in the environment, the subprocess flushes after every texture and can pass without exercising grouped uploads; RX_VK_ASTC_SPEC=0 likewise disables specialized pipelines.
Do: Run the fixture and its hazard probe with renderer switches removed from their environment, then set only the values required by each explicit test case.
@fix
1988922f57412f1d023cBeanstalk test farm
Commit
ff79b9e· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.Recommendation: Approve. The code is ready: only testing is left. The current implementation still needs in-game and hardware coverage, including the first-use cost of creating specialized pipelines. Earlier RX 580 results show a conversion-time gain, but they do not measure this head. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
412f1d023c. I rebased it ontomain(4908cc6dad). I edited its description to match the change.Changed
Changed in part (the rest is for the author)
Nothing was built or run: the checks run again on the new head.
The change converts large ASTC textures to BC3 using two steps by default, specializes the decoder and groups uploads. The fix creates specialized pipelines only for footprints encountered, reducing unnecessary startup work but potentially adding compilation time during play.
Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_texture.cpp:1125: The current head’s grouping and specialization have not been measured in the game against main. When: The reported game runs predate these changes, while the newer bench uploads only one texture per recording and therefore cannot measure grouping or its effect on frame pacing. Do: Run the planned interleaved game comparison against the merge base, including frame times and ASTC spans, and compare grouping on and off.gpu/vk/device_policy.h:829: The new default conversion route and upload ordering need coverage on the supported hardware they affect. When: Windows drivers, RDNA discrete GPUs and Steam Deck have not run the current path; the reported Linux RX 580 run cannot establish their output or frame pacing. Do: Run the stated game and conversion checks on the affected Tier 1 Windows and Linux hardware, including Steam Deck, and record output and frame-time results.gpu/vk/vk_texture.cpp:1006: The startup, cache and first-use costs of specialized decoder pipelines remain unmeasured. When: The first upload for each used footprint synchronously creates its specialized pipeline, potentially delaying that upload and its frame. Do: Measure cold and warm startup, first-use frame time and pipeline-cache growth on representative hardware.Checks: they run again on this head (
CI / Third-party parts and guide screenshots (pull_request),CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request),CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 1/2) (pull_request)failed on the last one); a failure shows on the pull request.Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven for this head. Earlier RX 580 runs reported 994 ms versus main's 1,134 ms for all ASTC GPU spans in one timing run; the current grouping and on-demand specialization have not been measured in game against main.
Other systems: The conversion and upload ordering affect Vulkan drivers and texture workloads across Windows and Linux. Windows, Intel, RDNA, Steam Deck and in-game NVIDIA coverage remains outstanding; the two-step route also allocates a 16 MB texel buffer when used.
Switches: RX_VK_ASTC_BC_SPLIT defaults to 1, selecting two steps; 0 selects one pass and 2 selects the cheaper encoder. RX_VK_ASTC_SPEC and RX_VK_ASTC_BC_GROUP default on and can be set to 0. The defaults remain subject to the outstanding hardware and in-game measurements; the fix updates the specialization switch documentation.
Reviewed:
412f1d023cagainst4908cc6dad: Read tests/test_astc_upload_gpu.py in full and the fix diff, pipeline creation and upload call site in gpu/vk/vk_texture.cpp. Read the repository instructions and PR template, and inspected the commit log and diff statistics. The full base diff and remaining changed code and generated files were not read in full; the adjacent Tooling instructions were unavailable.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run the project were executed. CI has not run on this head; the reported game and benchmark runs precede the on-demand pipeline change.
Overlaps and merge order: The pull request carries #2473's commits and can stand alone; if #2473 merges first, its duplicated commits need to fall away.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
Measured in the game on an RTX 3090 (Linux, 1080p fixed, no upscaler, uncapped): fps and hitches are within noise against main, and the conversion's GPU time is lower (all ASTC spans −9 %, a layer-array span −24 %). The table is under Measurements. Still WIP: the RX 580 in-game confirmation on a quiet lab and a Windows build are open.
412f1d023c890266eb19890266eb19bf3b9972a1WIP: perf(vk): big ASTC textures go to BC3 in two steps by default, with a leaner, specialized encode path and grouped uploadsto WIP: perf(vk): big ASTC textures go to BC3 through a texel buffer and Longshot's own encoder, uploads grouped, decoder specializedRewritten. The old head (
1988922f, and before it9b3022a3) carried #2473's six commits with our two on top. This head is three commits of our own on current main and no longer contains or depends on #2473. It adds the decoder's specialization constants, a texel-buffer route with a new encoder (bc3_from_texels.comp) and grouped barriers, and a lookup table for weight unquantization. Main's RGBA8-scratch path stays behind RX_VK_ASTC_BC_TEXELS=0. The game-free bench is in Measurements; the in-game lab runs are pending, so this stays WIP.@review
Recommendation: Approve. The code is ready: only testing is left. The game-free measurements show faster conversion for larger footprints, but the current implementation still needs in-game measurements and coverage across the hardware it affects. Startup and pipeline-cache costs also remain unmeasured. Recommend approval; not approved on the forge.
The change specializes ASTC decoding, adds a texel-buffer route and encoder for BC3, and groups uploads to reduce barriers. It adds pipeline compilation and 32 MB of buffers in exchange for measured conversion savings on larger footprints.
Testing before merging (3) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/vk_texture.cpp:1125: The current head’s grouping and specialization have not been measured in the game against main. When: The reported game runs predate these changes, while the newer bench uploads only one texture per recording and therefore cannot measure grouping or its effect on frame pacing. Do: Run the planned interleaved game comparison against the merge base, including frame times and ASTC spans, and compare grouping on and off.gpu/vk/device_policy.h:829: The new default conversion route and upload ordering need coverage on the supported hardware they affect. When: Windows drivers, RDNA discrete GPUs and Steam Deck have not run the current path; the reported Linux RX 580 run cannot establish their output or frame pacing. Do: Run the stated game and conversion checks on the affected Tier 1 Windows and Linux hardware, including Steam Deck, and record output and frame-time results.gpu/vk/vk_texture.cpp:1006: The startup, cache and first-use costs of specialized decoder pipelines remain unmeasured. When: The first upload for each used footprint synchronously creates its specialized pipeline, potentially delaying that upload and its frame. Do: Measure cold and warm startup, first-use frame time and pipeline-cache growth on representative hardware.Since the last review (on
412f1d023c)Still open: L2 (The current head’s grouping and specialization have not been measured in the game against…); L3 (The new default conversion route and upload ordering need coverage on the supported hardwa…); L4 (The startup, cache and first-use costs of specialized decoder pipelines remain unmeasured.); L5 (The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head…); L6 (The checkCI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)fails on this he…); L7 (The checkCI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on th…); L8 (The checkCI / Website build and checks (pull_request)fails on this head and passes on…); L9 (The checkCI / Game-free checks (run_all.py, part 1/2) (pull_request)fails on this head…); L10 (The checkCI / Game-free checks (run_all.py, part 2/2) (pull_request)fails on this head…)Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven in game. The PR reports median game-free conversion times 17–23% lower on RX 580 and 14–47% lower on RTX 3090 for 8×8 and larger footprints; the current head's in-game results are pending.
Other systems: The default route affects BC3 uploads across Vulkan GPUs and drivers, including Windows, Intel, RDNA and Steam Deck. BC7 and AMD-resized textures retain the scratch-image route; the described hardware coverage remains outstanding.
Switches: RX_VK_ASTC_SPEC, RX_VK_ASTC_BC_TEXELS and RX_VK_ASTC_BC_GROUP default on; RX_VK_ASTC_BC_ROWS defaults to 8 for a 64-wide subgroup and 4 otherwise. Their defaults still need the outstanding hardware and in-game measurements; the switch table is updated.
Reviewed:
bf3b9972a1against4908cc6dad: Read AGENTS.md, CONTRIBUTING.md, the changed ASTC decoder and BC3 route diffs, and the texel-route implementation. Generated shader headers, tests and remaining changed files were skimmed; the full changed code was not read.; nothing run (a code review).Checked and fine:
Testing: The PR reports game-free decoder and encoder checks on llvmpipe and a Linux renderer build. The current head needs the listed in-game comparisons, hardware coverage and pipeline-cost measurements; CI is still running.
Overlaps and merge order: #2473 proposed the same conversion approach; the rewritten PR states that it is independent and does not depend on it.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
bf3b9972a1ff79b9ed83Pushed
ff79b9ed. The lab's in-game pairs (RX 580) found a crash: grouping left a BC3 group pending when an RGBA8 upload's chunk flush ended the command buffer. It is fixed: replay_flush_upload flushes the group first, and tests/test_bc3_group_flush.py guards it. Two clean pairs followed, with zero crashes. The conversion's GPU time is 34 % lower in the game, and hitches are unchanged. The field walk measured about 4 % slower, still unexplained, so this stays WIP until an in-run A/B settles it. Details are in Measurements.In-build switch A/B on the RX 580 (same build and folder, 2 rounds): the texel route's field walk is level with main's route, slightly ahead (33.2 against 32.0 fps on average). Its conversions take 31 % less GPU time, and peak VRAM is the same on every side. The earlier 4 % gap came from comparing a freshly swapped game folder (cold pipeline caches, one short warm-up) with a warm one. The table is in Measurements. It stays WIP for the Windows build and the full test suite.
WIP: perf(vk): big ASTC textures go to BC3 through a texel buffer and Longshot's own encoder, uploads grouped, decoder specializedto perf(vk): big ASTC textures go to BC3 through a texel buffer and Longshot's own encoder, uploads grouped, decoder specializedRecommendation: Approve. The code is ready: only testing is left. The RX 580 runs show lower ASTC conversion time, but the new default route still needs coverage on other supported hardware and its pipeline startup and cache costs remain unmeasured. Recommend approval; not approved on the forge.
The change converts large ASTC textures to BC3 through buffers, groups uploads and specializes the decoder. It reduces conversion time on the tested RX 580 at the cost of additional buffers and pipelines.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
gpu/vk/device_policy.h:829: The new default conversion route and upload ordering need coverage on the supported hardware they affect. When: Windows drivers, RDNA discrete GPUs and Steam Deck have not run the current path; the reported Linux RX 580 run cannot establish their output or frame pacing. Do: Run the stated game and conversion checks on the affected Tier 1 Windows and Linux hardware, including Steam Deck, and record output and frame-time results.gpu/vk/vk_texture.cpp:1006: The startup, cache and first-use costs of specialized decoder pipelines remain unmeasured. When: The first upload for each used footprint synchronously creates its specialized pipeline, potentially delaying that upload and its frame. Do: Measure cold and warm startup, first-use frame time and pipeline-cache growth on representative hardware.Since the last review (on
bf3b9972a1)Resolved: L2 (The current head’s grouping and specialization have not been measured in the game against…); L6 (The check
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)fails on this he…); L7 (The checkCI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request)fails on th…)Still open: L3 (The new default conversion route and upload ordering need coverage on the supported hardwa…); L4 (The startup, cache and first-use costs of specialized decoder pipelines remain unmeasured.); L5 (The check
CI / Third-party parts and guide screenshots (pull_request)fails on this head…); L8 (The checkCI / Website build and checks (pull_request)fails on this head and passes on…); L9 (The checkCI / Game-free checks (run_all.py, part 1/2) (pull_request)fails on this head…); L10 (The checkCI / Game-free checks (run_all.py, part 2/2) (pull_request)fails on this head…)Checks: Failing on this head, which is behind its base, where they pass:
CI / Third-party parts and guide screenshots (pull_request),CI / Website build and checks (pull_request),CI / Game-free checks (run_all.py, part 1/2) (pull_request),PR description / Title and description (pull_request_target).@rebase(or@fix) brings it up to date and runs them again; not held against it. Still running:CI / Game-free checks (run_all.py, part 2/2) (pull_request).Also noticed (1; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes, for ASTC conversion on the tested RX 580: the reported in-game pass timing fell from 1,153 to 766 ms against main, and the same-build switch comparison fell from 1,120 to 776 ms. The reported frame-rate results do not establish a game-wide gain.
Other systems: The route affects GPUs that store ASTC as BC3, including Windows, Intel, RDNA and Steam Deck systems. Current-head in-game NVIDIA coverage is also outstanding. BC7 and AMD-resized textures retain the image route.
Switches: RX_VK_ASTC_SPEC, RX_VK_ASTC_BC_TEXELS and RX_VK_ASTC_BC_GROUP default on; RX_VK_ASTC_BC_ROWS selects encoder workgroup rows according to subgroup size. The RX 580 results support the route default, but broader hardware coverage and specialization costs remain open.
Reviewed:
ff79b9ed83against4908cc6dad: Read the repository rules and pull request template, the reported runs, the changed upload-flush path and its surrounding callers. Inspected the relevant portions of vk_texture.cpp, vk_replay.cpp and vk_texture.h and the new source-check test; the remaining changed code and generated shader headers were not read in full.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run. The author reports game-free checks and RX 580 in-game runs; the remaining hardware runs and pipeline-cost measurements are outstanding. One CI check is still running.
Overlaps and merge order: #2473 proposed the same conversion approach; the description says this implementation is independent.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as HumanBean took it out of WIP. Nothing was run; a maintainer decides.