fix(vk): preserve brightness in flash sampling across capture sizes #1537

Merged
Arkex-ai merged 1 commit from fix/flash-sampling-normalization into main 2026-11-10 07:48:18 +00:00
Arkex-ai commented 2026-11-10 07:16:18 +00:00 (Migrated from github.com)

PNG flash diagnostics divide by floored cell/stride counts rather than the number of samples visited. A constant white3440x1440 capture becomes18 in the first detector cell after byte wrapping (1920x1080 becomes77), so brightness changes can produce false flashes or reversed polarity. Remainder rows/columns are omitted, and small captures can divide by zero.

Partition the full capture into normalized64x36 cells, retain the four-pixel sampling stride, and divide by the actual sample count. Cells smaller than the grid repeat a valid pixel. The production cell/region detector, thresholds and filenames remain unchanged; game rendering, HUD and FOV are unaffected.

Validation at 04aa05d on main 509579b:

  • Execute the production sampling and downstream cell/region detector with synthetic RGBA images.84 constant-color/size combinations cover standard,43:18,32:9, odd and small dimensions; independently labeled source regions detect partition drift. Stable pictures and moving edges remain negative, a returning55-level pulse keeps its magnitude/polarity, and a40-level pulse stays below the48-level threshold.
  • Original main fails the constant, partition and detector assertions. Five removal/corruption mutations fail. Windows LLVM, Linux GCC and GCC ASan/UBSan pass.
  • Full Windows suite223 passed/2 failed/20 skipped versus exact main222/2/20, with the same NUP privilege/native SDK limitations. Official clean guest regeneration and matching API12 host/backend build pass after the ImGui merge.
  • Native FG2 with PNG flash and region diagnostics enabled produces fully decoded RGB3440x1440 PNG output, accepts maximize/restore and exits0. Original save hashes are unchanged. This is runtime compatibility; synthetic production-code controls prove the measurement contract, not campaign-wide flash detection accuracy.

docs/flash-sampling.md describes the diagnostic behavior. Resource readiness (#1472), host-cache visibility (#1502), normal PNG slot ownership (#1519), binary reader integrity (#1467) and sink errors (#1531) are separate contracts. The shared upstream Linux updater test failure is tracked in #1536; exact-head fork source/build/AppImage workflows follow. No game data, captures, generated game code or binaries are included.

Current-head validation

Current head 25bf24a, based on main 7d1562d. Earlier local/runtime results describe their recorded source hashes.

The standalone contribution patch is unchanged after the audited main refresh; exact-head build/source checks are refreshed below. Earlier runtime evidence remains tied to its recorded hash.

Fork runs are separate from upstream Actions approval; no maintainer approval gate is bypassed.

PNG flash diagnostics divide by floored cell/stride counts rather than the number of samples visited. A constant white3440x1440 capture becomes18 in the first detector cell after byte wrapping (1920x1080 becomes77), so brightness changes can produce false flashes or reversed polarity. Remainder rows/columns are omitted, and small captures can divide by zero. Partition the full capture into normalized64x36 cells, retain the four-pixel sampling stride, and divide by the actual sample count. Cells smaller than the grid repeat a valid pixel. The production cell/region detector, thresholds and filenames remain unchanged; game rendering, HUD and FOV are unaffected. Validation at `04aa05d` on main `509579b`: - Execute the production sampling and downstream cell/region detector with synthetic RGBA images.84 constant-color/size combinations cover standard,43:18,32:9, odd and small dimensions; independently labeled source regions detect partition drift. Stable pictures and moving edges remain negative, a returning55-level pulse keeps its magnitude/polarity, and a40-level pulse stays below the48-level threshold. - Original main fails the constant, partition and detector assertions. Five removal/corruption mutations fail. Windows LLVM, Linux GCC and GCC ASan/UBSan pass. - Full Windows suite223 passed/2 failed/20 skipped versus exact main222/2/20, with the same NUP privilege/native SDK limitations. Official clean guest regeneration and matching API12 host/backend build pass after the ImGui merge. - Native FG2 with PNG flash and region diagnostics enabled produces fully decoded RGB3440x1440 PNG output, accepts maximize/restore and exits0. Original save hashes are unchanged. This is runtime compatibility; synthetic production-code controls prove the measurement contract, not campaign-wide flash detection accuracy. `docs/flash-sampling.md` describes the diagnostic behavior. Resource readiness (#1472), host-cache visibility (#1502), normal PNG slot ownership (#1519), binary reader integrity (#1467) and sink errors (#1531) are separate contracts. The shared upstream Linux updater test failure is tracked in #1536; exact-head fork source/build/AppImage workflows follow. No game data, captures, generated game code or binaries are included. <!-- goal15-current-validation --> ### Current-head validation Current head `25bf24a`, based on main `7d1562d`. Earlier local/runtime results describe their recorded source hashes. The standalone contribution patch is unchanged after the audited main refresh; exact-head build/source checks are refreshed below. Earlier runtime evidence remains tied to its recorded hash. - [Linux AppImage](https://github.com/Arkex-ai/Hookshot/actions/runs/42774802994): in_progress. - [Windows builder](https://github.com/Arkex-ai/Hookshot/actions/runs/42774798698): success. - [Game-free source regressions](https://github.com/Arkex-ai/Hookshot/actions/runs/42774794899): success. Fork runs are separate from upstream Actions approval; no maintainer approval gate is bypassed.
Commenting is not possible because the repository is archived.
No description provided.