McRogueFace/tests/benchmarks
John McCardle f68a770346 feat(bench): Gauntlet OOM safety guards + The Crucible wall-clock benchmark; closes #353 closes #354
The Gauntlet's auto-ramp had a step ceiling but no memory ceiling. GRID TITAN
ramps grid side S with cost ~ S*S, but renders into a fixed viewport so frame
time can stay under budget while allocation runs away -- observed hard-locking
the desktop mid grid-allocation (all RAM consumed, forced logout).

#353 -- memory safety (defense in depth, weakest failure mode last):
  * tests/benchmarks/gauntlet/safety.py: rss_mb/vmsize_mb probes +
    install_address_space_cap() (RLIMIT_AS backstop; a runaway Grid() then
    aborts THIS process via std::bad_alloc instead of taking the machine down).
  * Trial.predict_bytes(load) + Trial.max_load: a trial refuses a load whose
    predicted footprint exceeds a 512 MB budget BEFORE allocating it. GRID
    TITAN implements both (S*S*~28 B; max_load=4300 ~= 494 MB).
  * RampController: pre-allocation predict/cap check + post-set_load RSS
    watchdog; records stop_reason (budget/hard_cap/max_load/mem_predict/
    mem_rss/max_steps). run_gauntlet.py installs the address-space cap at start.
  * tests/unit/gauntlet_safety_test.py proves the ramp bails on the memory
    guards before over-allocating (synthetic runaway trial records the largest
    load it was asked to build).

#354 -- The Crucible (tests/benchmarks/crucible.py): a headless, deterministic
wall-clock microbenchmark of fixed "comically extreme but tractable" configs
(grid alloc, cell fill, layer writes, turn-manager swarm, FOV, A*, entity
churn). Safe (<512 MB, ~seconds), display-free, cross-version (missing APIs
report "unsupported"). Emits JSON; MCRF_CRUCIBLE_BASELINE diffs two builds.

This is the safe replacement for the windowed-Gauntlet A/B that crashed the
desktop. First result, current master vs the 0.2.8 release artifact (both
headless): grid_alloc -58.9%, grid_fill -25.4%, layer_fill -56.1%,
entity_churn -43.0%, fov_storm -10.3%, step_swarm -6.2%, path_queries -3.2%;
geomean 0.673 (32.7% faster overall), peak RSS ~103 vs ~119 MB. Tracks the
#332 SoA rewrite + #329 entity indexing.

Suite 314/314.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 10:28:13 -04:00
..
baseline Gauntlet #340: menu layout polish; commit first captured baseline; closes #340 2026-07-02 20:48:22 -04:00
gauntlet feat(bench): Gauntlet OOM safety guards + The Crucible wall-clock benchmark; closes #353 closes #354 2026-07-11 10:28:13 -04:00
_baseline.py Phase 5.2: performance benchmark suite for grid/entity/FOV/pathfinding 2026-04-18 06:45:40 -04:00
benchmark_moving_entities.py Remove legacy string enum comparisons from InputState/Key/MouseButton, closes #306 2026-04-09 22:19:02 -04:00
benchmark_suite.py Remove camelCase module functions (setScale, findAll, getMetrics, setDevConsole), closes #304 2026-04-10 01:07:22 -04:00
crucible.py feat(bench): Gauntlet OOM safety guards + The Crucible wall-clock benchmark; closes #353 closes #354 2026-07-11 10:28:13 -04:00
dijkstra_bench.py Phase 5.2: performance benchmark suite for grid/entity/FOV/pathfinding 2026-04-18 06:45:40 -04:00
entity_scale_benchmark.py Timer overhaul: update tests 2026-01-03 22:44:53 -05:00
fov_opt_bench.py Phase 5.2: performance benchmark suite for grid/entity/FOV/pathfinding 2026-04-18 06:45:40 -04:00
grid_step_bench.py Phase 5.2: performance benchmark suite for grid/entity/FOV/pathfinding 2026-04-18 06:45:40 -04:00
gridview_render_bench.py Phase 5.2: performance benchmark suite for grid/entity/FOV/pathfinding 2026-04-18 06:45:40 -04:00
issue_331_property_read_bench.py Fast path for hot property getters: stop importing mcrfpy per call; closes #331 2026-07-08 21:58:50 -04:00
layer_performance_test.py Timer overhaul: update tests 2026-01-03 22:44:53 -05:00
pathfinding_bench.py Phase 5.2: performance benchmark suite for grid/entity/FOV/pathfinding 2026-04-18 06:45:40 -04:00
profile_workload.py docs(profiling): document screenshot/PNG trap; add full-loop workload 2026-07-10 21:54:39 -04:00
spatial_hash_bench.py Phase 5.2: performance benchmark suite for grid/entity/FOV/pathfinding 2026-04-18 06:45:40 -04:00
sprint_perf_baseline.py docs: durable sprint plan + baseline harness for perf batch #342-#348 2026-07-10 22:00:51 -04:00
stress_test_suite.py Timer overhaul: update tests 2026-01-03 22:44:53 -05:00
tcod_fov_isolated.py Timer overhaul: update tests 2026-01-03 22:44:53 -05:00
tcod_scale_test.py Timer overhaul: update tests 2026-01-03 22:44:53 -05:00