test(vk): the Linux pressure and target pool checks read #637's three-level pool pressure #1409

Open
TrashPanda wants to merge 1 commit from TrashPanda/Longshot:test/vram-637-checks into main
Contributor

Type: test · Risk: low · Tested on: Linux, game-free checks (g++ and clang 21) · Needs: none

Why

Two game-free checks have failed on main since #637 (8e3dfde6, the < 8 GB VRAM changes) went in: test_linux_pressure and test_target_image_pool. #637 renamed and reshaped what they read on purpose, but the checks still look for the old text. Every PR since lists them among the failures it didn't cause. This PR changes only the two checks; no source changes. #1323 and #1363 fix seven other checks that broke overnight; this one doesn't overlap them.

test_mirror_budget is left red on purpose. It also broke with #637, but there it caught a real change, not a stale check. #637's new rule in mirror_budget() for cards of 6.5 GB or less runs before mirror_budget.h's small-card rule. A 4 GB card now mirrors min(1700 MB, vram / 3), about 1.3 GB, where it got 256 MB before. #637 was tested on a 6 GB card only. That's a decision for #637's author and reviewers, asked on #637, not a test edit.

What changed

The two checks read #637's code as it is now. They still guard the same behaviour, and each one fails if the line it guards is undone.

  • tests/test_linux_pressure.py: the Linux memory hold on an integrated GPU gives back the target pool with pool_pressure = 2; (was pool_pressed = true;). Idle staging arenas are still freed when the PC enters memory pressure. Stale arenas are now freed past twice kArena ((stale && kept + it->size > kArena * 2) || linux_entered_pressure).
  • tests/test_target_image_pool.py: texture_frame sets the three levels (> 97% gives the pool back, > 90% halves it). pool_trim caps by them, and trims up to 64 images a present under pressure. The targets' pool takes block_size, still worked out from kImageBlock.

Measurements

Nothing to measure: tests only. The two checks fail on main @ 544229a2 and pass here (913e3661).

main @ 544229a2:
vk_texture.cpp: texture_frame() no longer has: pool_pressed = true;
AssertionError: 'pool_pressed ? 0 : pool_cap()' not found in 'size_t pool_trim() { ...
this PR @ 913e3661:
pass         1.2s  tests/test_linux_pressure.py
pass         0.0s  tests/test_target_image_pool.py

Flags and settings

None.

Testing

Tested:

  • Both checks on Linux with CXX=g++ and CXX=clang++ (clang 21.1.8): they fail on main @ 544229a2 and pass here.
  • Each check against a broken source. Setting the iGPU hold's pool_pressure = 2 to 0, dropping pool_trim's 64-a-present bound, or giving the targets' pool a different blockSize each make the matching check fail.
  • python -I -B tests/run_all.py on Linux: 605 passed, 35 failed, 81 skipped. Main @ 544229a2 on the same PC: 602 passed, 38 failed. These two checks and test_crash_record now pass; test_crash_record already passes on main when run alone. Nothing fails here that passes on main. The 35 that fail on main as well are this PC's missing packages and game folders (numpy, lz4, zstandard), the five #1323 fixes, the two #1363 fixes, test_mirror_budget (above), test_readback_timeout_source (#1251), test_display_startup_failure (#1279), test_tested_configurations (#1256's docs/tested file), test_pipeline_play_cache and test_present_thread.
  • test_staging_burst, the other check that reads the arenas' code, is skipped here because this PC has no Vulkan headers.

Not tested: Windows. These checks are standard library plus the compiler, and nothing here is Linux-only.

Must be tested: None.

Risks

What could break: nothing in the game; only two checks change.

Turning it off: revert the commit.

Compatibility: Nothing changes.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
**Type:** test · **Risk:** low · **Tested on:** Linux, game-free checks (g++ and clang 21) · **Needs:** none ## Why Two game-free checks have failed on `main` since #637 (8e3dfde6, the < 8 GB VRAM changes) went in: `test_linux_pressure` and `test_target_image_pool`. #637 renamed and reshaped what they read on purpose, but the checks still look for the old text. Every PR since lists them among the failures it didn't cause. This PR changes only the two checks; no source changes. #1323 and #1363 fix seven other checks that broke overnight; this one doesn't overlap them. **`test_mirror_budget` is left red on purpose.** It also broke with #637, but there it caught a real change, not a stale check. #637's new rule in `mirror_budget()` for cards of 6.5 GB or less runs before `mirror_budget.h`'s small-card rule. A 4 GB card now mirrors `min(1700 MB, vram / 3)`, about 1.3 GB, where it got 256 MB before. #637 was tested on a 6 GB card only. That's a decision for #637's author and reviewers, asked on #637, not a test edit. ## What changed The two checks read #637's code as it is now. They still guard the same behaviour, and each one fails if the line it guards is undone. - `tests/test_linux_pressure.py`: the Linux memory hold on an integrated GPU gives back the target pool with `pool_pressure = 2;` (was `pool_pressed = true;`). Idle staging arenas are still freed when the PC enters memory pressure. Stale arenas are now freed past twice `kArena` (`(stale && kept + it->size > kArena * 2) || linux_entered_pressure`). - `tests/test_target_image_pool.py`: `texture_frame` sets the three levels (`> 97%` gives the pool back, `> 90%` halves it). `pool_trim` caps by them, and trims up to 64 images a present under pressure. The targets' pool takes `block_size`, still worked out from `kImageBlock`. ## Measurements Nothing to measure: tests only. The two checks fail on `main` @ 544229a2 and pass here (913e3661). ``` main @ 544229a2: vk_texture.cpp: texture_frame() no longer has: pool_pressed = true; AssertionError: 'pool_pressed ? 0 : pool_cap()' not found in 'size_t pool_trim() { ... this PR @ 913e3661: pass 1.2s tests/test_linux_pressure.py pass 0.0s tests/test_target_image_pool.py ``` ### Flags and settings None. ## Testing **Tested:** - Both checks on Linux with `CXX=g++` and `CXX=clang++` (clang 21.1.8): they fail on `main` @ 544229a2 and pass here. - Each check against a broken source. Setting the iGPU hold's `pool_pressure = 2` to `0`, dropping `pool_trim`'s 64-a-present bound, or giving the targets' pool a different `blockSize` each make the matching check fail. - `python -I -B tests/run_all.py` on Linux: 605 passed, 35 failed, 81 skipped. Main @ 544229a2 on the same PC: 602 passed, 38 failed. These two checks and `test_crash_record` now pass; `test_crash_record` already passes on main when run alone. Nothing fails here that passes on main. The 35 that fail on main as well are this PC's missing packages and game folders (numpy, lz4, zstandard), the five #1323 fixes, the two #1363 fixes, `test_mirror_budget` (above), `test_readback_timeout_source` (#1251), `test_display_startup_failure` (#1279), `test_tested_configurations` (#1256's docs/tested file), `test_pipeline_play_cache` and `test_present_thread`. - `test_staging_burst`, the other check that reads the arenas' code, is skipped here because this PC has no Vulkan headers. **Not tested:** Windows. These checks are standard library plus the compiler, and nothing here is Linux-only. **Must be tested:** None. ## Risks **What could break:** nothing in the game; only two checks change. **Turning it off:** revert the commit. **Compatibility:** Nothing changes. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.
test(vk): the Linux pressure and target pool checks read #637's three-level pool pressure
Some checks are pending
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
913e366168
#637 (8e3dfde6) replaced the target pool's pool_pressed flag with
pool_pressure (0 normal, 1 halved above 90%, 2 given back above 97% or
under the Linux hold on an iGPU), gave the targets' own image pool a
block size of its own (16 MB at most on cards of 8 GB or less, from
kImageBlock), and keeps stale staging arenas up to twice kArena. The
two checks still looked for the old text and failed on main.

test_linux_pressure looks for pool_pressure = 2 in the iGPU hold and
the arenas' new condition, which still frees them on entering
pressure. test_target_image_pool looks for the three levels in
texture_frame and pool_trim and for the pool's block_size, still taken
from kImageBlock. Each fails when the line it guards is undone.

Assisted-by: Claude Opus 5.5
TrashPanda changed title from WIP: test(vk): the Linux pressure and target pool checks read #637's three-level pool pressure to test(vk): the Linux pressure and target pool checks read #637's three-level pool pressure 2026-11-17 13:18:53 +00:00
Some checks are pending
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request has changes conflicting with the target branch.
  • tests/test_target_image_pool.py
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'test/vram-637-checks:TrashPanda-test/vram-637-checks'
git switch 'TrashPanda-test/vram-637-checks'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1409
No description provided.