Files
RetroArch/.github/workflows/scripts/stack-frame-sweep.ref
T
libretroadmin c26315f8b3 stack-frame-sweep: every frame in the graphics objects, against the ceiling
CODING-GUIDELINES puts a ceiling on a function's stack frame and nothing
checked it. The frames this was written for were twelve kilobytes - a
glyph chunk in each of four font drivers, and a batch of overlays in the
Vulkan one - and they had been there for years, because a large local
array compiles, and runs, on a machine with a desktop's stack. It is
only a problem where the stack is smallest, which is the platform
nobody runs the suite on.

The sweep reads the release objects the menu-harness job already builds
and sums the probes a prologue makes, since a frame that size is built a
page at a time. Four functions are over and stay that way, each recorded
with what it is: a CRT mode switch, the shader cache written and read
once a pass, and a preview probe. Anything else over four kilobytes
fails, and a recorded one that grows fails too.

Checked by putting the twelve kilobyte glyph chunk back: the sweep names
it and the run fails.
2026-09-13 12:23:36 +02:00

16 lines
729 B
Plaintext

# function bytes (release build, x86-64 GCC)
#
# Over the ceiling and left that way, each with its reason. A frame
# that is not listed here fails the sweep; one that grows past what is
# recorded fails too, and the number moves in the commit that grows it.
#
# switch_res_crt a CRT mode switch, once when the resolution
# changes, on the main thread
# spirv_cache_save shader cache written once per compiled pass,
# spirv_cache_load read once per pass at load
# gfx_anim_preview_probe probes a preview file, off the frame path
switch_res_crt 4440
spirv_cache_save 4312
spirv_cache_load 4296
gfx_anim_preview_probe 4128