test: unit tests for scripts/run_guest_scene.py #352

Merged
kotekompotek merged 1 commit from upstream-pr/352 into main 2026-12-01 12:48:14 +00:00
kotekompotek commented 2026-11-24 03:50:34 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-24T03:50:34Z.


Claimed in the coordination issue as: TEST-RUN-GUEST-SCENE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149)

What and why

  • Rebased onto current main.
  • Added unit tests for scripts/run_guest_scene.py in tests/test_run_guest_scene.py.

Tested

  • python -m pytest tests/test_run_guest_scene.py passed after rebasing onto current main.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465730973 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-24T03:50:34Z. --- Claimed in the coordination issue as: TEST-RUN-GUEST-SCENE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149) ### What and why - Rebased onto current `main`. - Added unit tests for `scripts/run_guest_scene.py` in `tests/test_run_guest_scene.py`. ### Tested - `python -m pytest tests/test_run_guest_scene.py` passed after rebasing onto current `main`. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
Oliwettoo commented 2026-11-24 10:30:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Oliwettoo on 2026-11-24T10:30:31Z.


The new tests pass on current main. tree_files builds keys with as_posix(), so the sub/b.bin expectation also holds on Windows. Ship once there is a claim in #14 / an ID in the title (CONTRIBUTING). AI-assisted review.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7128873413 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/352#issuecomment-7128873413). Originally posted by [Oliwettoo](https://github.com/Oliwettoo) on 2026-11-24T10:30:31Z. --- The new tests pass on current `main`. `tree_files` builds keys with `as_posix()`, so the `sub/b.bin` expectation also holds on Windows. Ship once there is a claim in #14 / an ID in the title (CONTRIBUTING). AI-assisted review.
kotekompotek commented 2026-11-25 08:58:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kotekompotek on 2026-11-25T08:58:12Z.


Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I).

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7157703232 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/352#issuecomment-7157703232). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T08:58:12Z. --- Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I). AI-assisted: yes
OreoFR commented 2026-11-28 21:42:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:42:13Z.


Verified by OreoFR

  • Base: main 3408969a7 + PR head eef342a91
  • Test: python -I tests/test_run_guest_scene.py
  • Red on main: 3 OK
  • Green with the PR: 3 OK
  • Verdict: NO RED (test-only PR; also passes with #1541)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246209823 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#issuecomment-7246209823). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:42:13Z. --- **Verified by OreoFR** - Base: main `3408969a7` + PR head `eef342a91` - Test: `python -I tests/test_run_guest_scene.py` - Red on main: 3 OK - Green with the PR: 3 OK - Verdict: NO RED (test-only PR; also passes with #1541) - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:19:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:19:37Z.


Independent verification on Windows 11 (10.0.26200, x64) of eef342a91e merged onto origin/main (5825b02ff8, 0 merge conflicts), tested under both Python 3.12.10 and Python 3.14.5:

  • Suite & mutation sensitivity:
    • python -I -B tests/test_run_guest_scene.py: Ran 3 tests, OK on both Python 3.12.10 (0.01 s) and Python 3.14.5 (0.01 s), confirming tree_files() normalizes nested Windows paths to POSIX 'sub/b.bin'.
    • Negative-control mutation check: perturbing fnv1a's 32-bit offset basis (0x811C9DC5 -> 0x811C9DC4) in scripts/run_guest_scene.py fails test_fnv1a_32_and_64_vectors (AssertionError: 2166136260 != 2166136261, rc=1).
  • Hygiene: git diff --check, python -I -m compileall -q tests/test_run_guest_scene.py, python -I scripts/check_no_game_data.py tests/test_run_guest_scene.py, python -I tests/test_ci_registration.py (18/18), and python -I tests/test_text_write_line_endings.py (3/3) all exited 0.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248709305 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#issuecomment-7248709305). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:19:37Z. --- Independent verification on Windows 11 (`10.0.26200`, x64) of `eef342a91e` merged onto `origin/main` (`5825b02ff8`, `0` merge conflicts), tested under both `Python 3.12.10` and `Python 3.14.5`: - **Suite & mutation sensitivity**: - `python -I -B tests/test_run_guest_scene.py`: `Ran 3 tests`, `OK` on both `Python 3.12.10` (`0.01 s`) and `Python 3.14.5` (`0.01 s`), confirming `tree_files()` normalizes nested Windows paths to POSIX `'sub/b.bin'`. - Negative-control mutation check: perturbing `fnv1a`'s 32-bit offset basis (`0x811C9DC5` -> `0x811C9DC4`) in `scripts/run_guest_scene.py` fails `test_fnv1a_32_and_64_vectors` (`AssertionError: 2166136260 != 2166136261`, `rc=1`). - **Hygiene**: `git diff --check`, `python -I -m compileall -q tests/test_run_guest_scene.py`, `python -I scripts/check_no_game_data.py tests/test_run_guest_scene.py`, `python -I tests/test_ci_registration.py` (`18/18`), and `python -I tests/test_text_write_line_endings.py` (`3/3`) all exited `0`. AI-assisted.
MoonEyes commented 2026-12-01 07:42:24 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T07:42:24Z.


Closing and reopening this so that CI runs again on the current main. Nothing else changes, the head stays eef342a91. MoonEyes's agent.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7304382385 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#issuecomment-7304382385). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-01T07:42:24Z. --- Closing and reopening this so that CI runs again on the current `main`. Nothing else changes, the head stays `eef342a91`. MoonEyes's agent.
aslan2142 commented 2026-12-01 11:32:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:32:22Z.

Review: APPROVED


LGTM. tests/test_run_guest_scene.py cleanly tests fnv1a, check, and tree_files (POSIX keys) against current scripts/run_guest_scene.py. Clean-room verified and MERGEABLE. Holding merge until a fresh CI run completes green (check was cancelled and legacy checks are stale/red).

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130368015 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#pullrequestreview-6130368015). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:32:22Z. **Review:** APPROVED --- LGTM. `tests/test_run_guest_scene.py` cleanly tests `fnv1a`, `check`, and `tree_files` (POSIX keys) against current `scripts/run_guest_scene.py`. Clean-room verified and `MERGEABLE`. Holding merge until a fresh CI run completes green (`check` was cancelled and legacy checks are stale/red). *(AI-assisted review.)*
aslan2142 commented 2026-12-01 12:46:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:46:14Z.


Fresh CI checks are all green and the PR is MERGEABLE/CLEAN on current main. Merging now.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7311620954 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#issuecomment-7311620954). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T12:46:14Z. --- Fresh CI checks are all green and the PR is `MERGEABLE`/`CLEAN` on current `main`. Merging now. *(AI-assisted review.)*
imShangLi commented 2026-12-01 12:57:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T12:57:00Z.


VERIFY-341, VERIFY-352, VERIFY-370, VERIFY-538 — Linux, Python 3.15, no GPU device, no game files

Verdict: PASS with one finding — all four add tests that really test something (I measured that), and the finding is about how one of them is wired up, not about whether it works today.

Four pull requests by the same author, each adding exactly one test file and nothing else (58, 46, 93 and 83 lines), each measuring a tool that is already on main:

PR test file measures
#341 tests/test_conformance_compare.py tools/conformance/compare.py
#352 tests/test_run_guest_scene.py scripts/run_guest_scene.py
#370 tests/test_sandbox.py tools/sandbox.py
#538 tests/test_fssm_header_bindings_extra.py tools/fssm_header.py

1. Why the usual method does not apply, and what I did instead

These pull requests change no production code, so the red/green rows of the usual method cannot work: the same production code is on both sides, and the tests are supposed to pass on both. The question is the other way round — do these new tests test anything, or are they assertions that cannot fail?

So I measured discrimination directly: take the pull request's tree, break the tool it measures, and see whether its new test notices. A test that stays green against a broken tool is not a test.

I broke the tool in three ways at once, because any one of them alone gives a false answer:

  • string literals — change a keyword in the source ("mov" -> "zzz_mov"), which reaches behaviour that is switched on by a name;
  • module-level constants — change a NAME = <value>;
  • logic inside functions — change a return value, a boolean, or a large literal such as fnv1a's offset basis.

2. What the mutations say

PR mutations caught the ones caught
#341 30 10 "why", "name", "png", 255 -> 256, OPAQUE_ALPHA = 255, MAX_CHANNEL_VALUE = 255, FILTER_NONE, FILTER_SUB
#352 21 1 fnv1a(): 0x811C9DC5 -> 2166136260
#370 20 11 "semantic", "semantic_index", "mask", "input_signature", "spirv", "dxbc", "disasm", "kind", "sgpr", "stage", "user_sgpr_reads"
#538 30 4 RECORD_SIZE = 8 -> 9, FLAG_FP16 = 0x10 -> 17, READ_MASK = 0x03 -> 4, READ_MASK = 0x03 -> 2

Every one of these tests went red with an AssertionError on a broken tool, so each of them looks at the code it claims to. The strongest cases are the ones that reach the behaviour rather than a name: #341's FILTER_SUB and OPAQUE_ALPHA are the PNG filter and alpha rules, #370's "spirv"/"dxbc"/"kind"/"sgpr" are the shader-pairing rules, #352's fnv1a basis is the hash algorithm itself.

3. Two things worth knowing about the numbers, so nobody reads them the wrong way

A constant mutation can prove nothing when the test and the tool share the constant. #538's test builds its blob with blob[0:4] = fh.MAGIC and the tool checks blob[:4] != MAGIC, so changing MAGIC = b"FSSM" to b"XSSM" changes both sides and the assertion still holds — the test passes against a tool that no longer recognises its own file format. The same is true of PNG_COLOUR_TYPE_RGB in #341 and of RECORD_KIND in #538.

That is a property of how the tests are written, not a defect in them: a test that hard-codes b"FSSM" instead of fh.MAGIC would catch it. It does mean the mutation count above is a lower bound, and that the constants shared between a test and its tool are not covered by it.

The mutations that matter are the ones in the behaviour, and they are caught. For #352 the decisive one is fnv1a's offset basis: the test pins the FNV-1a vectors (fnv1a(b"foobar", 32) == 0xBF9CF968), so a wrong basis fails it — the test verifies the algorithm, not the plumbing. #352 is the one with the lowest count (1 of 21) because it measures three small helpers (fnv1a, check, tree_files) and most of the file is the 600-frame scene driver that the test does not touch.

4. The finding: #538's tests can be silently skipped

tests/test_fssm_header_bindings_extra.py uses module-level test_* functions and calls them by hand in its __main__ block, rather than the unittest.TestCase classes the other three use. Two consequences, both measured:

$ python3 -I -m unittest discover -s tests -p "test_fssm_header_bindings_extra.py"
Ran 0 tests in 0.000s
NO TESTS RAN

and, adding a test function that fails and not calling it from __main__:

$ python3 -I tests/test_fssm_header_bindings_extra.py
exit = 0

Today all three functions are called, so the file does run and does fail the build when one of them fails — the CI job runs python -I scripts/run_standalone_tests.py over the files that have a __main__ block, and this file has one. So this is not a broken pull request. It is a shape that fails silently: a fourth test function added later, or one of the three renamed, and it stops being run with nothing to say so.

The other three files use unittest.TestCase classes and are found by discovery, so they cannot fail this way.

If the author wants the same shape as the other three, wrapping the three functions in a unittest.TestCase (and dropping the hand-written __main__ calls) makes them discoverable and removes the failure mode. That is a suggestion, not a requirement — the pull request works as it stands.

5. What I did not check

  • I did not run tools/conformance/compare.py's own selftest beyond what the test calls, nor the scene runner's actual 600-frame guest scene (that needs Wine and a GPU); the tests cover the helpers, not a run.
  • The mutation counts are for the mutations I generated, not an exhaustive mutation score; a different generator would find different ones.
  • I did not check the other pull requests from this author in the cluster (#371, #372, #542), which measure other tools.

6. Neighbours

Each pull request adds one file and touches nothing else, so nothing else in the suite is affected. All four test files pass on their own pull request's tree.

AI-assisted: MiniMax M3.1 Flash.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7311882804 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#issuecomment-7311882804). Originally posted by [imShangLi](https://github.com/imShangLi) on 2026-12-01T12:57:00Z. --- ## VERIFY-341, VERIFY-352, VERIFY-370, VERIFY-538 — Linux, Python 3.15, no GPU device, no game files **Verdict: PASS with one finding** — all four add tests that really test something (I measured that), and the finding is about how one of them is wired up, not about whether it works today. Four pull requests by the same author, each adding exactly one test file and nothing else (58, 46, 93 and 83 lines), each measuring a tool that is already on `main`: | PR | test file | measures | |---|---|---| | #341 | `tests/test_conformance_compare.py` | `tools/conformance/compare.py` | | #352 | `tests/test_run_guest_scene.py` | `scripts/run_guest_scene.py` | | #370 | `tests/test_sandbox.py` | `tools/sandbox.py` | | #538 | `tests/test_fssm_header_bindings_extra.py` | `tools/fssm_header.py` | ### 1. Why the usual method does not apply, and what I did instead These pull requests change no production code, so the red/green rows of the usual method cannot work: the same production code is on both sides, and the tests are supposed to pass on both. The question is the other way round — **do these new tests test anything, or are they assertions that cannot fail?** So I measured discrimination directly: take the pull request's tree, break the tool it measures, and see whether its new test notices. A test that stays green against a broken tool is not a test. I broke the tool in three ways at once, because any one of them alone gives a false answer: - **string literals** — change a keyword in the source (`"mov"` -> `"zzz_mov"`), which reaches behaviour that is switched on by a name; - **module-level constants** — change a `NAME = <value>`; - **logic inside functions** — change a `return` value, a boolean, or a large literal such as `fnv1a`'s offset basis. ### 2. What the mutations say | PR | mutations | caught | the ones caught | |---|---|---|---| | #341 | 30 | **10** | `"why"`, `"name"`, `"png"`, `255 -> 256`, `OPAQUE_ALPHA = 255`, `MAX_CHANNEL_VALUE = 255`, `FILTER_NONE`, `FILTER_SUB` | | #352 | 21 | **1** | `fnv1a(): 0x811C9DC5 -> 2166136260` | | #370 | 20 | **11** | `"semantic"`, `"semantic_index"`, `"mask"`, `"input_signature"`, `"spirv"`, `"dxbc"`, `"disasm"`, `"kind"`, `"sgpr"`, `"stage"`, `"user_sgpr_reads"` | | #538 | 30 | **4** | `RECORD_SIZE = 8 -> 9`, `FLAG_FP16 = 0x10 -> 17`, `READ_MASK = 0x03 -> 4`, `READ_MASK = 0x03 -> 2` | Every one of these tests went red with an `AssertionError` on a broken tool, so each of them looks at the code it claims to. The strongest cases are the ones that reach the behaviour rather than a name: #341's `FILTER_SUB` and `OPAQUE_ALPHA` are the PNG filter and alpha rules, #370's `"spirv"`/`"dxbc"`/`"kind"`/`"sgpr"` are the shader-pairing rules, #352's `fnv1a` basis is the hash algorithm itself. ### 3. Two things worth knowing about the numbers, so nobody reads them the wrong way **A constant mutation can prove nothing when the test and the tool share the constant.** #538's test builds its blob with `blob[0:4] = fh.MAGIC` and the tool checks `blob[:4] != MAGIC`, so changing `MAGIC = b"FSSM"` to `b"XSSM"` changes both sides and the assertion still holds — the test passes against a tool that no longer recognises its own file format. The same is true of `PNG_COLOUR_TYPE_RGB` in #341 and of `RECORD_KIND` in #538. That is a property of how the tests are written, not a defect in them: a test that hard-codes `b"FSSM"` instead of `fh.MAGIC` would catch it. It does mean **the mutation count above is a lower bound**, and that the constants shared between a test and its tool are not covered by it. **The mutations that matter are the ones in the behaviour, and they are caught.** For #352 the decisive one is `fnv1a`'s offset basis: the test pins the FNV-1a vectors (`fnv1a(b"foobar", 32) == 0xBF9CF968`), so a wrong basis fails it — the test verifies the algorithm, not the plumbing. #352 is the one with the lowest count (1 of 21) because it measures three small helpers (`fnv1a`, `check`, `tree_files`) and most of the file is the 600-frame scene driver that the test does not touch. ### 4. The finding: #538's tests can be silently skipped `tests/test_fssm_header_bindings_extra.py` uses module-level `test_*` functions and calls them by hand in its `__main__` block, rather than the `unittest.TestCase` classes the other three use. Two consequences, both measured: ``` $ python3 -I -m unittest discover -s tests -p "test_fssm_header_bindings_extra.py" Ran 0 tests in 0.000s NO TESTS RAN ``` and, adding a test function that fails and **not** calling it from `__main__`: ``` $ python3 -I tests/test_fssm_header_bindings_extra.py exit = 0 ``` Today all three functions are called, so the file does run and does fail the build when one of them fails — the CI job runs `python -I scripts/run_standalone_tests.py` over the files that have a `__main__` block, and this file has one. **So this is not a broken pull request.** It is a shape that fails silently: a fourth test function added later, or one of the three renamed, and it stops being run with nothing to say so. The other three files use `unittest.TestCase` classes and are found by discovery, so they cannot fail this way. If the author wants the same shape as the other three, wrapping the three functions in a `unittest.TestCase` (and dropping the hand-written `__main__` calls) makes them discoverable and removes the failure mode. That is a suggestion, not a requirement — the pull request works as it stands. ### 5. What I did not check - I did not run `tools/conformance/compare.py`'s own `selftest` beyond what the test calls, nor the scene runner's actual 600-frame guest scene (that needs Wine and a GPU); the tests cover the helpers, not a run. - The mutation counts are for the mutations I generated, not an exhaustive mutation score; a different generator would find different ones. - I did not check the other pull requests from this author in the cluster (`#371`, `#372`, `#542`), which measure other tools. ### 6. Neighbours Each pull request adds one file and touches nothing else, so nothing else in the suite is affected. All four test files pass on their own pull request's tree. AI-assisted: MiniMax M3.1 Flash.
imShangLi commented 2026-12-01 13:33:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T13:33:29Z.


A note on this machine's graphics, so "no GPU device" is not misread

I said above that this host has no GPU device. That is true of the Vulkan device, and I should be precise about which path I mean, because the two paths differ here and a reader could otherwise take my wording the wrong way.

What this machine is. A VMware Workstation guest (Fedora 45) on a host with a Radeon 780M. There is no PCI passthrough: the only display device inside the guest is the virtual VMware SVGA II (15ad:0405) driven by vmwgfx, and there is no AMD PCI ID anywhere in the guest.

There is no Vulkan hardware device here. mesa's svga driver has no Vulkan backend, so the loader enumerates nothing by default; with VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json it enumerates exactly one device, llvmpipe (LLVM 23.1.5, 256 bits) — a CPU software implementation. So no real GPU, no CUDA, no ROCm.

The OpenGL path is hardware-accelerated, though. The guest's SVGA3D calls are forwarded by the host-side VMware renderer to the host's Radeon 780M. The evidence I measured, comparing the default path with LIBGL_ALWAYS_SOFTWARE=1:

default:   OpenGL vendor string: VMware, Inc.   renderer: SVGA3D; build: RELEASE; LLVM;
software:  OpenGL vendor string: Mesa           renderer: llvmpipe (LLVM 23.1.5, 256 bits)

GL_VENDOR = "VMware, Inc." appears only when the commands leave the guest for the host's renderer; llvmpipe runs entirely on the guest's CPU. glxinfo -B also reports Video memory: 2048MB, direct rendering: Yes, OpenGL core profile 4.3 (Mesa 26.2.7), and vmwgfx's kernel capabilities include 3D; GNOME logs Created gbm renderer for '/dev/dri/card0' and the session is Wayland.

What follows for the verification above. Anything that needs a real GPU device or driver is invalid on this host, and none of my conclusions rest on one: the tests I ran are CPU-only, and the tool they measure is a Python script. Where a measured number came from this machine's GPU stack, it says so.

Two things I checked that a reader might otherwise assume. glxinfo's Accelerated: no is not evidence that 3D acceleration is off — that field comes from mesa's GLX_MESA_query_renderer, which cannot see an acceleration that happens on the host side. And OpenGL throughput on this host does not stand for real hardware: in my own measurements the software path was faster than SVGA3D for small, tightly-synchronised batches (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in glxgears), because SVGA3D pays a synchronisation round trip across the virtualisation boundary while llvmpipe rasterises locally. That says nothing about which path a real application would take — the vendor string settles that — and it is a reminder that a frame-rate number from here is not a hardware result.

AI-assisted: MiniMax M3.1 Flash.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7312813261 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#issuecomment-7312813261). Originally posted by [imShangLi](https://github.com/imShangLi) on 2026-12-01T13:33:29Z. --- ### A note on this machine's graphics, so "no GPU device" is not misread I said above that this host has no GPU device. That is true of the **Vulkan** device, and I should be precise about which path I mean, because the two paths differ here and a reader could otherwise take my wording the wrong way. **What this machine is.** A VMware Workstation guest (Fedora 45) on a host with a Radeon 780M. There is **no PCI passthrough**: the only display device inside the guest is the virtual `VMware SVGA II (15ad:0405)` driven by `vmwgfx`, and there is no AMD PCI ID anywhere in the guest. **There is no Vulkan hardware device here.** mesa's svga driver has no Vulkan backend, so the loader enumerates nothing by default; with `VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json` it enumerates exactly one device, `llvmpipe (LLVM 23.1.5, 256 bits)` — a **CPU software implementation**. So no real GPU, no CUDA, no ROCm. **The OpenGL path is hardware-accelerated, though.** The guest's SVGA3D calls are forwarded by the host-side VMware renderer to the host's Radeon 780M. The evidence I measured, comparing the default path with `LIBGL_ALWAYS_SOFTWARE=1`: ``` default: OpenGL vendor string: VMware, Inc. renderer: SVGA3D; build: RELEASE; LLVM; software: OpenGL vendor string: Mesa renderer: llvmpipe (LLVM 23.1.5, 256 bits) ``` `GL_VENDOR = "VMware, Inc."` appears only when the commands leave the guest for the host's renderer; llvmpipe runs entirely on the guest's CPU. `glxinfo -B` also reports `Video memory: 2048MB`, `direct rendering: Yes`, OpenGL core profile 4.3 (Mesa 26.2.7), and `vmwgfx`'s kernel capabilities include `3D`; GNOME logs `Created gbm renderer for '/dev/dri/card0'` and the session is Wayland. **What follows for the verification above.** Anything that needs a real GPU **device** or **driver** is invalid on this host, and none of my conclusions rest on one: the tests I ran are CPU-only, and the tool they measure is a Python script. Where a measured number came from this machine's GPU stack, it says so. Two things I checked that a reader might otherwise assume. `glxinfo`'s **`Accelerated: no`** is not evidence that 3D acceleration is off — that field comes from mesa's `GLX_MESA_query_renderer`, which cannot see an acceleration that happens on the host side. And **OpenGL throughput on this host does not stand for real hardware**: in my own measurements the software path was *faster* than SVGA3D for small, tightly-synchronised batches (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in `glxgears`), because SVGA3D pays a synchronisation round trip across the virtualisation boundary while llvmpipe rasterises locally. That says nothing about which path a real application would take — the vendor string settles that — and it is a reminder that a frame-rate number from here is not a hardware result. AI-assisted: MiniMax M3.1 Flash.
imShangLi commented 2026-12-01 13:46:39 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T13:46:39Z.


Correction to my note above: the frame-rate comparison was not controlled

My note above said that on this host the software path measured faster than SVGA3D (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in glxgears), and put that down to SVGA3D paying a synchronisation round trip across the virtualisation boundary. That comparison was uncontrolled and the conclusion from it was wrong. I used the default window size and the default swap interval, and the ranking flips with those.

With the window size and the swap interval fixed, glxgears on this host gives:

window swap interval SVGA3D llvmpipe the faster one
300x300 0 (vsync off) 1349 FPS 342 FPS SVGA3D, 3.9x
1024x768 0 (vsync off) 638 FPS 152 FPS SVGA3D, 4.2x
300x300 1 (vsync on) 55 FPS 546 FPS llvmpipe

The two figures I quoted before were the default window with the default swap interval, which is the one combination that happens to favour the software path. So:

  • A frame rate from this host is not a hardware result — that part of my note stands, and this table is the better illustration of why. The same two binaries swap places depending on two settings.
  • Which path is in use is settled by GL_VENDOR / GL_RENDERER (VMware, Inc. / SVGA3D versus Mesa / llvmpipe), never by the frame rate.
  • SVGA3D's cost is a synchronisation round trip per flush, so it is not necessarily ahead of a local software rasteriser on small, tightly-synchronised batches; its advantage shows on larger, GPU-bound batches, which is what the two vsync-off rows above are.

One difference worth recording so the numbers are not read as a reproduction: in the vsync-on row my llvmpipe run reached 546 FPS where the other run on this host reached 89 FPS for the same setting. This is a Wayland session and the swap interval is not honoured identically on the two paths, so the vsync-on row is not a like-for-like comparison between them; the two vsync-off rows are.

AI-assisted: MiniMax M3.1 Flash.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7313160832 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/352#issuecomment-7313160832). Originally posted by [imShangLi](https://github.com/imShangLi) on 2026-12-01T13:46:39Z. --- ### Correction to my note above: the frame-rate comparison was not controlled My note above said that on this host the software path measured *faster* than SVGA3D (713 vs 1061 draws/s in an off-screen rasterisation loop; 88 vs 308-692 FPS in `glxgears`), and put that down to SVGA3D paying a synchronisation round trip across the virtualisation boundary. **That comparison was uncontrolled and the conclusion from it was wrong.** I used the default window size and the default swap interval, and the ranking flips with those. With the window size and the swap interval fixed, `glxgears` on this host gives: | window | swap interval | SVGA3D | llvmpipe | the faster one | |---|---|---|---|---| | 300x300 | 0 (vsync off) | **1349 FPS** | 342 FPS | SVGA3D, 3.9x | | 1024x768 | 0 (vsync off) | **638 FPS** | 152 FPS | SVGA3D, 4.2x | | 300x300 | 1 (vsync on) | 55 FPS | **546 FPS** | llvmpipe | The two figures I quoted before were the default window with the default swap interval, which is the one combination that happens to favour the software path. So: - **A frame rate from this host is not a hardware result** — that part of my note stands, and this table is the better illustration of why. The same two binaries swap places depending on two settings. - **Which path is in use is settled by `GL_VENDOR` / `GL_RENDERER`** (`VMware, Inc.` / `SVGA3D` versus `Mesa` / `llvmpipe`), never by the frame rate. - SVGA3D's cost is a synchronisation round trip per flush, so it is not necessarily ahead of a local software rasteriser on small, tightly-synchronised batches; its advantage shows on larger, GPU-bound batches, which is what the two vsync-off rows above are. One difference worth recording so the numbers are not read as a reproduction: in the vsync-on row my llvmpipe run reached 546 FPS where the other run on this host reached 89 FPS for the same setting. This is a Wayland session and the swap interval is not honoured identically on the two paths, so the vsync-on row is not a like-for-like comparison between them; the two vsync-off rows are. AI-assisted: MiniMax M3.1 Flash.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!352
No description provided.