McRogueFace/tests/benchmarks/baseline/phase5_2/dijkstra_bench.json
John McCardle 767d0d4b0f Extend pathfinding API with heuristics, multi-root Dijkstra, and FLEE primitives; refs #315
Phase A (Python surface):
- New mcrfpy.Heuristic IntEnum: EUCLIDEAN, MANHATTAN, CHEBYSHEV, DIAGONAL, ZERO
- Grid.find_path() accepts heuristic= and weight= kwargs (weighted A*)
- Grid.get_dijkstra_map() accepts roots= (list of positions or DiscreteMap mask)

Phase B (FLEE primitives):
- DijkstraMap.invert() returns a new map with inverted distance field
- DijkstraMap.descent_step(pos) returns steepest-descent neighbor or None

DijkstraMap internally switched from the C++ TCODDijkstra wrapper to the C API
(TCOD_dijkstra_*) because multi-root compute and invert/get_descent are not
exposed on the wrapper. Single-root Dijkstra cache is preserved for backward
compatibility; multi-root and mask paths bypass the cache since cache keys
would be ill-defined.

New tests: heuristic_enum_test, find_path_heuristic_test, multi_root_dijkstra_test,
dijkstra_flee_test. Baseline JSONs for dijkstra_bench and gridview_render_bench
refreshed against the new implementation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 09:18:49 -04:00

86 lines
No EOL
1.7 KiB
JSON

{
"runs": [
{
"grid": "100x100",
"kind": "multi_root",
"roots": 1,
"mean_ms": 0.6948539987206459
},
{
"grid": "100x100",
"kind": "multi_root",
"roots": 2,
"mean_ms": 0.8002225775271654
},
{
"grid": "100x100",
"kind": "multi_root",
"roots": 5,
"mean_ms": 1.1821302119642496
},
{
"grid": "100x100",
"kind": "multi_root",
"roots": 20,
"mean_ms": 2.0206935703754425
},
{
"grid": "100x100",
"kind": "mask",
"roots": 500,
"mean_ms": 24.073211615905166
},
{
"grid": "100x100",
"kind": "invert",
"mean_ms": 0.7887090090662241
},
{
"grid": "100x100",
"kind": "descent_step_per_call",
"mean_us": 0.3262499812990427,
"valid_per_trial": 100
},
{
"grid": "500x500",
"kind": "multi_root",
"roots": 1,
"mean_ms": 20.39959062822163
},
{
"grid": "500x500",
"kind": "multi_root",
"roots": 2,
"mean_ms": 22.81180394347757
},
{
"grid": "500x500",
"kind": "multi_root",
"roots": 5,
"mean_ms": 29.194996040314436
},
{
"grid": "500x500",
"kind": "multi_root",
"roots": 20,
"mean_ms": 67.84450197592378
},
{
"grid": "500x500",
"kind": "mask",
"roots": 12500,
"mean_ms": 19711.241053813137
},
{
"grid": "500x500",
"kind": "invert",
"mean_ms": 27.875673002563417
},
{
"grid": "500x500",
"kind": "descent_step_per_call",
"mean_us": 0.3495373670011759,
"valid_per_trial": 2500
}
]
}