Regression test for shader pre-build on a fresh cache #3

Closed
opened 2026-11-25 15:04:00 +00:00 by HandshakeHackin · 1 comment
HandshakeHackin commented 2026-11-25 15:04:00 +00:00 (Migrated from github.com)
Contributor

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-25T15:04:00Z.


Following up on PastiiJay/klbf-lab-beta#6. The fix is present on the beta branch at ac838b5. Passing an empty input directory exercises the real Windows CLI setup and exits before any shader pack is required. Here's a regression test for first-run setup.

Save as check_cold_cache.py and run py -3 check_cold_cache.py C:\path\to\victory.exe. Each run uses a new temporary cache and cleans up afterward.

import os
import subprocess
import sys
from pathlib import Path
from tempfile import TemporaryDirectory

victory = Path(sys.argv[1]).resolve(strict=True)
with TemporaryDirectory() as tmp:
    root = Path(tmp)
    inputs = root / "empty-input"
    inputs.mkdir()
    cache = root / "cache"
    env = os.environ.copy()
    env.pop("VICTORY_CONFIG", None)
    env["VICTORY_CACHE_DIR"] = str(cache)
    subprocess.run(
        [str(victory), "translate", "--cache", "--pipelines", str(inputs)],
        cwd=root, env=env, check=True, timeout=60,
    )
    if not (cache / "pipelines").is_dir():
        sys.exit("FAIL: pre-build returned without creating cache/pipelines")
    print("PASS: pre-build created cache/pipelines on a cold start")

Expected on the affected build: the CLI exits successfully but the directory check fails. Expected with the Lab 39 fix: PASS. I traced the beta source and tested both outcomes of the check with stand-in executables on Linux. If anyone has both Windows builds handy, the two results would help confirm this is suitable for Windows CI. This covers directory initialization only.

<!-- greyfinch-sync:PastiiJay/klbf-lab:issue:6607477305 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/issues/3). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-25T15:04:00Z. --- Following up on PastiiJay/klbf-lab-beta#6. The fix is present on the beta branch at ac838b5. Passing an empty input directory exercises the real Windows CLI setup and exits before any shader pack is required. Here's a regression test for first-run setup. Save as check_cold_cache.py and run `py -3 check_cold_cache.py C:\path\to\victory.exe`. Each run uses a new temporary cache and cleans up afterward. ~~~python import os import subprocess import sys from pathlib import Path from tempfile import TemporaryDirectory victory = Path(sys.argv[1]).resolve(strict=True) with TemporaryDirectory() as tmp: root = Path(tmp) inputs = root / "empty-input" inputs.mkdir() cache = root / "cache" env = os.environ.copy() env.pop("VICTORY_CONFIG", None) env["VICTORY_CACHE_DIR"] = str(cache) subprocess.run( [str(victory), "translate", "--cache", "--pipelines", str(inputs)], cwd=root, env=env, check=True, timeout=60, ) if not (cache / "pipelines").is_dir(): sys.exit("FAIL: pre-build returned without creating cache/pipelines") print("PASS: pre-build created cache/pipelines on a cold start") ~~~ Expected on the affected build: the CLI exits successfully but the directory check fails. Expected with the Lab 39 fix: PASS. I traced the beta source and tested both outcomes of the check with stand-in executables on Linux. If anyone has both Windows builds handy, the two results would help confirm this is suitable for Windows CI. This covers directory initialization only.
PastiiJay commented 2026-11-25 15:17:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-25T15:17:49Z.


Thanks @HandshakeHackin, a handy check for the fresh-cache case. We'll run it against the next test builds; if you'd like it in the repo, feel free to open it as a PR (e.g. under docs/klbf/ or a tests folder) and we'll merge it.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7166616993 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/issues/3#issuecomment-7166616993). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-25T15:17:49Z. --- Thanks @HandshakeHackin, a handy check for the fresh-cache case. We'll run it against the next test builds; if you'd like it in the repo, feel free to open it as a PR (e.g. under docs/klbf/ or a tests folder) and we'll merge it.
Sign in to join this conversation.
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
PastiiJay/klbf-lab#3
No description provided.