From 79a5541d27da743f2c1ea1826c0f5d81e90e928a Mon Sep 17 00:00:00 2001 From: Pascal Severin Date: Sun, 4 Oct 2026 11:40:41 +0200 Subject: [PATCH 1/2] [M2-SPRITE-02] MSVC fix: explicit size_t -> u32 cast in submit (C4267) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The merge-lane CI (run 37189830435) failed on the Windows x64 (MSVC 2022) job only: sprite_renderer.cpp(557) warning C4267 ('initializing': conversion from 'size_t' to 'uint32_t', possible loss of data) treated as an error under /WX. The PR lane labels Windows gated (ci:windows), so MSVC had not compiled this step's code before the merge. Root cause: `const std::uint32_t n = batcher.frameCount();` — SpriteBatcher::frameCount() returns std::size_t; on the 64-bit MSVC toolchain the implicit narrowing is a C4267. The value is always <= the batcher's u32 capacity (kSpriteBatcherMaxCapacity), so the narrowing is lossless; the fix is the explicit static_cast (the house style for the size_t -> u32 boundary, e.g. the instance pack above it). Full audit of the step's new MSVC-unverified files (sprite_renderer.h, sprite_renderer.cpp, sprite_draw_tests.cpp, the gl_context.h/.cpp frameBuffer additions): no other implicit narrowing remains (every other size_t source is an explicit static_cast or a comparison). Local verification: canonical tree rebuilds warning-free; ctest -R sprite_draw green. Windows verification: the ci:windows label is applied to this PR so the MSVC job runs on the PR lane before merge. --- src/laige-render/sprite_renderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/laige-render/sprite_renderer.cpp b/src/laige-render/sprite_renderer.cpp index 4661dd8..dc630ce 100644 --- a/src/laige-render/sprite_renderer.cpp +++ b/src/laige-render/sprite_renderer.cpp @@ -553,8 +553,10 @@ laige::Status SpriteRenderer::submit(SpriteBatcher& batcher, if (!batcher.frameBuilt()) { return laige::Status(laige::ErrorCode::InvalidArgument); } - // 4. The frame budget (PERF-008: bounded, rate-limited Warn). - const std::uint32_t n = batcher.frameCount(); + // 4. The frame budget (PERF-008: bounded, rate-limited Warn). The + // frame count is always <= the batcher's u32 capacity, so the + // narrowing is lossless (MSVC C4267). + const std::uint32_t n = static_cast(batcher.frameCount()); if (n > i.maxInstances) { LAIGE_LOG_WARN("sprite_renderer", "instance_capacity", "The frame exceeds the renderer instance budget; it is " From 5d1fa7d7604ee8ecba6cf8f6579efa280fe26cb6 Mon Sep 17 00:00:00 2001 From: Pascal Severin Date: Sun, 4 Oct 2026 12:06:48 +0200 Subject: [PATCH 2/2] Trigger CI: re-evaluate job selection under the ci:windows label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The branch's first CI run (37192995927) was created before the ci:windows label was applied, so its label context is stale — a rerun reuses the original event and the windows-msvc job stays skipped. This empty commit fires a fresh pull_request event with the current labels so the Windows x64 (MSVC 2022) job (the one this fix targets) runs on the PR lane before merge. No code change.