Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
471094e
tests: v_cvt_{u16,i16}_f16 ignore clamp and omod, as the translator d…
Bloh09 Nov 28, 2026
f1e43c6
runtime: gta6rt link options end with /STACK again (CI-RUNTIME-STACK-…
Bloh09 Nov 28, 2026
35a025e
tests: the macOS pool dedupe test no longer asks the real volume (CI-…
Bloh09 Nov 28, 2026
24abe91
make_game: the index-shape error and the clone hint (CI-MAKEGAME-INDE…
Bloh09 Nov 28, 2026
e147773
progress_dashboard, preflight test: the default repo is the one the R…
Bloh09 Nov 28, 2026
b1a3e93
tests: the sampler census fixture adds the index to the table pointer…
Bloh09 Nov 28, 2026
6a1ccf0
tests: spirv_metal_set0 tests follow the encoding, stderr line and sy…
Bloh09 Nov 28, 2026
ff5ef7f
tools, scripts: four programs guard stdout with errors=replace (CI-ST…
Bloh09 Nov 28, 2026
d98fc7f
tests: the boot journal seed test compares long paths on Windows (CI-…
Bloh09 Nov 28, 2026
381b33c
tests: the wine safety test stubs xdpyinfo (CI-WINE-SAFETY-XDPYINFO-S…
Bloh09 Nov 28, 2026
51a3b3b
runtime: pipeline_workers_test accepts the OOM push_back that libstdc…
Bloh09 Nov 28, 2026
a531410
runtime: xs_proxy_mock times the list-value gate with steady_clock (C…
Bloh09 Nov 28, 2026
1d582d5
runtime: vk_bindless_dimensions skips a device whose sized arrays hol…
Bloh09 Nov 28, 2026
2c9a491
runtime: cs_imgatomic_ext uses the volume T# words vk_store_test expe…
Bloh09 Nov 28, 2026
ad58c98
tests: the ps1 parameter parser keeps a parameter whose attribute has…
Bloh09 Nov 28, 2026
bf574cf
docs: links and the clone line follow the README rewrite (CI-README-R…
Bloh09 Nov 28, 2026
bbbdba8
run_game_wine.sh: lowercase the device ids with tr, not ${x,,}, so ba…
Bloh09 Nov 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ builds into `Documents\Leonida`; `python -I make_game.py --help` lists every opt
of work space (the asset export alone about 370 GB), Python 3.12+, the .NET 8 SDK, the Vulkan SDK, LLVM 21+ with the
AMDGPU target for `llvm-mc` (`scripts\build_llvm_mc.ps1` builds one on Windows) and, for the runtime stage, Visual
Studio 2022 with the Windows SDK 10.0.26100 or newer; `--stages check,shaders,runtime` needs about 30 GB. Clone with
`--recursive` for the `third_party/rpf9-explorer` submodule. [docs/design.md](docs/design.md) has the formats and the
`git clone --recursive https://github.com/ProjectLeonida/mandy` for the `third_party/rpf9-explorer` submodule. [docs/design.md](docs/design.md) has the formats and the
translator's contract, [docs/linux.md](docs/linux.md) the Linux steps.

| Piece | Where it stands |
Expand Down
2 changes: 1 addition & 1 deletion d3d12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ On a Ryzen 5 7600X with a GeForce RTX 4060 Ti 16 GB, the Series X profile render
frames a second is not reached yet. On RTX 40 and 50 cards, DLSS frame generation is on by default when NVIDIA's
files are there (`Get-NVIDIA-DLSS.cmd`): it shows twice the frames, held to 28 a second by Reflex
(`LEONIDA_FG_LIMIT_FPS`) with presents paced evenly (`LEONIDA_PRESENT_SMOOTH`); `-NoFrameGen` turns it off. The
measurements and what is still wrong in the picture are in the [top-level README](../README.md#project-status).
measurements and what is still wrong in the picture are in the [top-level README](../README.md#where-it-stands).

## Leonida's picture fixes

Expand Down
4 changes: 2 additions & 2 deletions docs/i18n/ar/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# دليل البدء السريع لمشروع Leonida

الوثائق الإنجليزية هي المرجع المعتمد. يستند هذا الدليل إلى المراجعة `561b65a` ويغطي خطوات البدء الأساسية.
راجع [ملف README بالإنجليزية](../../../README.md#project-status) لمعرفة حالة المشروع الحالية، و[فهرس الوثائق](../../README.md) للمزيد من التفاصيل.
راجع [ملف README بالإنجليزية](../../../README.md#where-it-stands) لمعرفة حالة المشروع الحالية، و[فهرس الوثائق](../../README.md) للمزيد من التفاصيل.

## ما هو Leonida؟

Expand Down Expand Up @@ -72,7 +72,7 @@ python -I make_game.py --game "D:\path\to\package" --out "D:\Games\Leonida" --wo

يعمل `make_game.py` على Linux، ويجد `llvm-mc` تلقائيًا إذا كان ضمن `PATH`. تأكد من أن نسخته تدعم AMDGPU.
يعمل محمّل اللعبة، وهو برنامج Windows، عبر Wine أو Proton. إذا كان لديك بناء Windows جاهز للمحمّل،
فمرّر مجلده باستخدام `--runtime-build`. راجع [تعليمات البناء والتشغيل على Linux](../../../README.md#running-the-loader-on-linux).
فمرّر مجلده باستخدام `--runtime-build`. راجع [تعليمات البناء والتشغيل على Linux](../../linux.md).

## حل المشاكل الشائعة

Expand Down
6 changes: 2 additions & 4 deletions make_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ def ensure_submodule() -> None:
core = os.path.join(ROOT, "third_party", "rpf9-explorer", "Core")
if submodule_ready():
return
clone = "git clone --recursive https://github.com/ubiquitarianism/leonida"
clone = "git clone --recursive https://github.com/ProjectLeonida/mandy"
git = shutil.which("git")
if not git:
fail("third_party/rpf9-explorer is missing (a \"Download ZIP\" from GitHub leaves it out). Install Git "
Expand Down Expand Up @@ -1323,7 +1323,7 @@ def read_translation_index(index: str) -> dict:
with open(index, encoding="utf-8-sig") as f:
shaders = json.load(f)
if not isinstance(shaders, dict):
raise ValueError("expected a JSON object keyed by shader name")
raise ValueError("must contain a JSON object keyed by shader name")
return shaders


Expand Down Expand Up @@ -2976,8 +2976,6 @@ def require_translated_shaders(work: str) -> str:
except (OSError, ValueError) as e:
fail(f"The translated shader index {index} is unreadable ({getattr(e, 'strerror', None) or e}): "
"run the shaders stage again.")
if not isinstance(translated, dict):
fail(f"The translated shader index {index} must contain a JSON object. Run the shaders stage again.")
if not translated:
# A build from before the shaders stage refused an empty merge can carry this marker.
fail(f"The translated shader index {index} is empty, so there is nothing to check. Run the shaders stage again.")
Expand Down
3 changes: 2 additions & 1 deletion runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ if(WIN32 AND LEONIDA_BUILD_WINDOWS_RUNTIME)
# /MAP writes gta6rt.map next to the exe (link.exe and lld-link): gta6rt_no_tls_callbacks names each TLS callback from
# it, to tell the C++ runtime's __dyn_tls_init (tlsdyn.obj) and __dyn_tls_dtor (tlsdtor.obj) from Rust std's own
# callback. It does not change the exe.
target_link_options(gta6rt PRIVATE /OPT:NOREF ${GTA6RT_HOST_BASE} /STACK:${GTA6RT_STACK} /MAP)
# /STACK goes last: tests/test_build_runtime_fallback.py reads the reserve at the end of this line.
target_link_options(gta6rt PRIVATE /OPT:NOREF ${GTA6RT_HOST_BASE} /MAP /STACK:${GTA6RT_STACK})
target_link_libraries(gta6rt PRIVATE gta6rt_bcpack gta6rt_d3d12_xs_rootsig gta6rt_xtaskqueue psapi)

# Root-signature forwarding test: needs a real PC d3d12.lib to serialize the synthetic descriptors.
Expand Down
7 changes: 5 additions & 2 deletions runtime/test/pipeline_workers_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,17 @@ void oom_during_start_and_enqueue() {
}
check(!threw, "hard oom on first batch threw instead of running inline");
for (auto& c : calls) check(c == 1, "hard oom inline fallback lost or repeated a job");
// libstdc++'s deque owns its first node from construction, so the one push_back may succeed; the batch is
// then counted and the caller runs it. When the push does fail, the inline fallback counts nothing.
const auto during = pool.stats();
check(during.started == 0 && during.batches == 0 && during.jobs == 0 && during.running == 0,
const bool pushed = during.batches == 1;
check(during.started == 0 && during.running == 0 && (pushed ? during.jobs == 6 : during.batches == 0 && during.jobs == 0),
"hard oom inline fallback kept stats clean");

std::vector<std::atomic<int>> after(5);
pool.run(after.size(), [&](std::size_t i) { after[i].fetch_add(1); });
for (auto& c : after) check(c == 1, "batch after hard oom lost or repeated a job");
check(pool.stats().started == 4 && pool.stats().batches == 1 && pool.stats().running == 0,
check(pool.stats().started == 4 && pool.stats().batches == during.batches + 1 && pool.stats().running == 0,
"pool works normally once memory is available again");
}
}
Expand Down
4 changes: 2 additions & 2 deletions runtime/test/shaders/cs_imgatomic_ext.asm
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ s_mov_b32 s8, 0x5000
s_mov_b32 s9, 0x1400000
s_mov_b32 s10, 0x55
s_mov_b32 s11, 0x55
s_mov_b32 s12, 0x55
s_mov_b32 s12, 0x80000055
s_mov_b32 s13, 0x55
s_mov_b32 s14, 0x55
s_mov_b32 s15, 0x55
s_mov_b32 s15, 0xd7801800
s_mov_b32 s16, 0x2000
s_mov_b32 s17, 0x1400000
s_mov_b32 s18, 0x22
Expand Down
12 changes: 12 additions & 0 deletions runtime/test/vk_bindless_dimensions_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,18 @@ int main() {
return 77;
}

// The limits above are only the sampled-image ones; the sizing also answers to the resource and set limits (an
// Apple Paravirtual device under MoltenVK stops at the 256 defaults). Below live_images there is nothing to test.
for (const ImageDimension dimension :
{ImageDimension::dim_1d, ImageDimension::dim_2d_array, ImageDimension::dim_3d}) {
const std::uint32_t sized = features.counts[bindless::sampled_binding(dimension)];
if (sized <= live_images) {
std::printf("unsupported: the device's limits size the %s array at %u indices, too few for %u images\n",
name(dimension), sized, live_images);
return 77;
}
}

const std::vector<std::uint32_t> code = load_spirv(LEONIDA_TEST_BINDLESS_DIMENSIONS_SPV);
EXPECT(!code.empty());
const std::uint32_t max_layers = properties.properties.limits.maxImageArrayLayers;
Expand Down
6 changes: 4 additions & 2 deletions runtime/test/xs_proxy_mock_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4295,10 +4295,12 @@ int check_list_values() {
raw(lv, 14, 1, 1, 1);
EXPECT(hr_of(raw(lv, 9)) == S_OK);
g_queue_call_count = 0;
const ULONGLONG started = GetTickCount64();
// steady_clock, not GetTickCount64: its 15.6 ms steps can report 15 ms for a 30 ms wait
const auto started = std::chrono::steady_clock::now();
EXPECT(submit(qb, lv) == 0);
EXPECT(g_queue_call_count == 2 && queue_call_is(0, qb_mock, 15, word(b_gate), 2));
EXPECT(xs::list_values_idle(3000) && fence_completed(b_gate) == 2 && GetTickCount64() - started >= 20);
EXPECT(xs::list_values_idle(3000) && fence_completed(b_gate) == 2 &&
std::chrono::steady_clock::now() - started >= std::chrono::milliseconds(20));
stats = xs::list_value_stats();
EXPECT(stats.gates_timed_out == 1 && stats.waits_met_at_submit >= 1);
xs::set_list_value_wait_timeout_ms(5000);
Expand Down
4 changes: 4 additions & 0 deletions scripts/bench_translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,8 @@ def main(argv=None):


if __name__ == "__main__":
try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
sys.stdout.reconfigure(errors="replace")
except (AttributeError, ValueError, OSError):
pass
sys.exit(main())
4 changes: 4 additions & 0 deletions scripts/export_old_pr_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,8 @@ def main(argv=None) -> int:


if __name__ == "__main__":
try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
sys.stdout.reconfigure(errors="replace")
except (AttributeError, ValueError, OSError):
pass
sys.exit(main())
5 changes: 3 additions & 2 deletions scripts/run_game_wine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,14 @@ DRM_SYSFS=${LEONIDA_DRM_SYSFS_DIR:-/sys/class/drm}
if [ -n "$DEVICE" ]; then
export MESA_VK_DEVICE_SELECT="$DEVICE!"
# kwin and Xwayland's glamor on the card that renders, so the present path stays on one device.
dev_lc=${DEVICE,,}
lc() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]'; } # not ${x,,}: macOS's bash 3.2 lacks it
dev_lc=$(lc "$DEVICE")
for n in "$DRM_SYSFS"/renderD*; do
[ -e "$n" ] || continue
ven=$(cat "$n/device/vendor" 2>/dev/null || true)
did=$(cat "$n/device/device" 2>/dev/null || true)
ven=${ven//$'\r'/}; did=${did//$'\r'/}
[ "${ven,,}:${did,,}" = "0x${dev_lc%%:*}:0x${dev_lc#*:}" ] \
[ "$(lc "$ven"):$(lc "$did")" = "0x${dev_lc%%:*}:0x${dev_lc#*:}" ] \
&& export KWIN_DRM_DEVICES=/dev/dri/${n##*/}
done
else
Expand Down
26 changes: 23 additions & 3 deletions tests/semantic/test_valu_cvt_f16_int16_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,30 @@ def test_sdwa_clamp(self):
self.assertEqual(words[0], 0x0000FFFE) # -2 clamped to +0.0 in WORD_1, WORD_0 preserved
self.assertEqual(words[1], 0x00003C00) # 2 clamped to 1.0 in WORD_0, WORD_1 padded with 0

def test_f16_to_int16_output_modifiers_still_rejected(self):
def test_f16_to_int16_output_modifiers_are_hardware_noops(self):
# Measured on RDNA2: clamp and mul:/div: change nothing on an integer destination (rdna2spirv.py, v_cvt_*_f16).
words = run_ps([
"v_mov_b32 v0, 0xdead4500",
"v_cvt_u16_f16 v0, v0 clamp",
"v_mov_b32 v1, 0xbeefc000",
"v_cvt_i16_f16 v1, v1 mul:4",
"v_mov_b32 v2, 0xcafe4200",
"v_cvt_u16_f16 v2, v2 div:2",
"v_mov_b32 v3, 0x0000c000",
"v_cvt_i16_f16_sdwa v3, v3 clamp dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_0",
"exp mrt0 v0, v1, v2, v3 done vm",
"s_endpgm",
])
self.assertEqual(words[0], 0xDEAD0005) # 5.0, not clamped to 1
self.assertEqual(words[1], 0xBEEFFFFE) # -2.0, not scaled
self.assertEqual(words[2], 0xCAFE0003) # 3.0, not halved
self.assertEqual(words[3], 0x0000FFFE) # SDWA clamp ignored too

def test_f16_to_int16_unknown_modifiers_still_rejected(self):
for op in ("v_cvt_u16_f16", "v_cvt_i16_f16"):
with self.subTest(op=op), self.assertRaises(rdna2spirv.Unsupported):
translate_lines("ps_cvt_f16_reject", [f"{op} v0, v0 clamp", "exp mrt0 v0, v0, v0, v0 done vm", "s_endpgm"])
for form, mod in ((op, "mul:8"), (op + "_e32", "clamp")):
with self.subTest(form=form, mod=mod), self.assertRaises(rdna2spirv.Unsupported):
translate_lines("ps_cvt_f16_reject", [f"{form} v0, v0 {mod}", "exp mrt0 v0, v0, v0, v0 done vm", "s_endpgm"])


if __name__ == "__main__":
Expand Down
4 changes: 3 additions & 1 deletion tests/test_bcpack_history_calib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,9 @@ class PathDeduplicationAndGuardTest(unittest.TestCase):
def _darwin(case_sensitive_result):
fake_os = mock.Mock(wraps=os, pathconf=mock.Mock(return_value=case_sensitive_result))
fake_os.path.normcase = posixpath.normcase
return mock.patch.multiple(report_paths, sys=mock.Mock(platform="darwin"), os=fake_os)
# The scratch-folder probe asks the real volume, which on a Mac is case-insensitive whatever pathconf says here.
return mock.patch.multiple(report_paths, sys=mock.Mock(platform="darwin"), os=fake_os,
_same_resolved_name=mock.Mock(return_value=False))

def test_resolve_pools_deduplicates_macos_case_and_accents_and_keeps_case_sensitive(self):
with mock.patch.object(calib._ttpf, "find_pools", side_effect=lambda p: [p]):
Expand Down
14 changes: 12 additions & 2 deletions tests/test_docs_cli_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ def extract_ps1_params(content):

params = set()
for part in parts:
decl = part.split("=", 1)[0]
# The default starts at the first "=" outside brackets: [Parameter(Mandatory = $true)][string]$Game has one inside.
nest, cut = 0, len(part)
for i, ch in enumerate(part):
if ch in "([{":
nest += 1
elif ch in ")]}":
nest -= 1
elif ch == "=" and nest == 0:
cut = i
break
decl = part[:cut]
vars_found = re.findall(r"\$([a-zA-Z_][a-zA-Z0-9_]*)", decl)
if vars_found:
params.add(vars_found[-1].lower())
Expand Down Expand Up @@ -251,7 +261,7 @@ def test_checkers_report_only_the_missing_flag(self):
self.assertEqual(tool_flag_mismatches(pages, sources), [])

ps1_pages = {"docs/b.md": "```\n.\\scripts\\test.ps1 -ValidParam -BadParam\n```\n"}
ps1_sources = {"scripts/test.ps1": "param([string]$ValidParam)"}
ps1_sources = {"scripts/test.ps1": "param([Parameter(Mandatory = $true)][string]$ValidParam)"}
self.assertEqual(ps1_flag_mismatches(ps1_pages, ps1_sources), [("docs/b.md:2", "scripts/test.ps1", "-BadParam")])
rust = '#[arg(long)]\n/// doc\npub one_submit: bool,\n#[arg(short, long)]\nno_merge: bool,\n'
self.assertEqual(clap_long_flags(rust), ["--one-submit", "--no-merge"])
Expand Down
4 changes: 2 additions & 2 deletions tests/test_make_game_preflight.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ def test_ensure_submodule_missing_fails_cleanly(self):
with mock.patch.object(make_game, "ROOT", tmp), \
mock.patch("shutil.which", return_value=None):
self.assert_fails(make_game.ensure_submodule,
match="git clone --recursive https://github.com/ubiquitarianism/leonida")
match="git clone --recursive https://github.com/ProjectLeonida/mandy")

def test_ensure_submodule_zip_with_git_does_not_say_install_git(self):
with tempfile.TemporaryDirectory() as tmp:
Expand All @@ -824,7 +824,7 @@ def test_ensure_submodule_zip_with_git_does_not_say_install_git(self):
mock.patch("shutil.which", return_value="/usr/bin/git"), \
mock.patch("subprocess.run", return_value=not_a_repo):
err = self.assert_fails(make_game.ensure_submodule,
match="git clone --recursive https://github.com/ubiquitarianism/leonida")
match="git clone --recursive https://github.com/ProjectLeonida/mandy")
self.assertNotIn("Install Git", err)

def test_ensure_submodule_names_the_clone_command_the_readme_gives(self):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_run_game_wine_safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def test_uppercase_device_inner_bash_lock_parent_and_summary_exit_propagation(se
_write_lf(sbin / "flock", "#!/usr/bin/env bash\nexit 0\n", executable=True)
_write_lf(sbin / "pkill", "#!/usr/bin/env bash\nexit 0\n", executable=True)
_write_lf(sbin / "timeout", "#!/usr/bin/env bash\nshift 3\n\"$@\"\n", executable=True)
# --visible probes DISPLAY with xdpyinfo when the host has one; the fake :99 must not depend on that.
_write_lf(sbin / "xdpyinfo", "#!/usr/bin/env bash\nexit 0\n", executable=True)
_write_lf(
sbin / "python3",
"#!/usr/bin/env bash\n"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sampler_source_census.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def test_statistics_bound_what_the_classes_cannot_decide(self):
("s_add_u32 s10, s10, 0x7fff0000", 8),
("s_mov_b32 s11, 0", 4),
("s_load_dwordx8 s[20:27], s[10:11], 0x800", 8),
("s_lshl3_add_u32 s8, s8, 0x30", 4),
("s_lshl3_add_u32 s8, 6, s8", 4),
("s_mov_b32 s9, 0", 4),
("s_load_dwordx4 s[28:31], s[8:9], 0x10", 8),
SAMPLE, END,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_spirv_metal_set0_cli_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def test_spirv_as_that_cannot_be_started(self):
def test_spirv_as_that_fails(self):
lines = self.assert_failed(self.run_tool(sys.executable, sys.executable))
# spirv-as writes to the terminal itself; the tool's own line comes last.
self.assertEqual(lines[-1], f"ERROR: {sys.executable} failed with exit status 2")
# The first line spirv-as printed to stderr follows the exit status.
self.assertTrue(lines[-1].startswith(f"ERROR: {sys.executable} failed with exit status 2: "), lines)
self.assertEqual([line for line in lines if line.startswith("ERROR: ")], lines[-1:])

def test_usage_and_layout_still_work_through_cli(self):
Expand Down
12 changes: 6 additions & 6 deletions tests/test_spirv_metal_set0_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def _make_fake_spirv_tools(dis_name="spirv-dis", asm_name="spirv-as"):
"""Return a subprocess.run replacement backed by the synthetic SPIR-V binary codec."""
calls: list[list[str]] = []

def fake_run(cmd, check=False, capture_output=False, text=False, input=None, errors=None):
def fake_run(cmd, check=False, capture_output=False, text=False, input=None, errors=None, encoding=None):
calls.append(list(cmd))
exe = cmd[0]
if exe == dis_name:
Expand Down Expand Up @@ -699,7 +699,7 @@ def test_out_of_bounds_set0_binding_raises_system_exit(self):
self.assertIn("%bad", str(ctx.exception))
self.assertIn(f"binding {b}", str(ctx.exception))

def test_missing_uint32_type_raises_when_runtime_array_rewritten(self):
def test_missing_uint32_type_is_declared_before_the_array_length(self):
base = """\
OpDecorate %images DescriptorSet 0
OpDecorate %images Binding 0
Expand All @@ -716,9 +716,9 @@ def test_missing_uint32_type_raises_when_runtime_array_rewritten(self):
("unsigned_64", "%u64 = OpTypeInt 64 0"),
):
with self.subTest(case=label):
with self.assertRaises(SystemExit) as ctx:
m.rewrite(base.format(int_decl=int_decl), [4096])
self.assertIn("no 32-bit uint type", str(ctx.exception))
out = m.rewrite(base.format(int_decl=int_decl), [4096])
self.assertEqual(out.count("%msl_uint = OpTypeInt 32 0"), 1)
self.assertLess(out.index("%msl_uint = OpTypeInt 32 0"), out.index("%msl_cap_b0 = OpConstant %msl_uint 4096"))


class TestMainAndCli(unittest.TestCase):
Expand Down Expand Up @@ -904,7 +904,7 @@ def test_target_env_extraction_and_env_var_overrides(self):
disasm = header_text + "OpCapability Shader\n"
seen_cmds = []

def run_stub(cmd, check=False, capture_output=False, text=False, input=None, errors=None):
def run_stub(cmd, check=False, capture_output=False, text=False, input=None, errors=None, encoding=None):
seen_cmds.append((list(cmd), check, capture_output, text, input))
if len(seen_cmds) == 1:
return subprocess.CompletedProcess(cmd, 0, disasm, "")
Expand Down
Loading
Loading