Add disabled GPS momentum penalty prototype

This commit is contained in:
2026-06-27 02:42:21 -05:00
parent 7ee09de73f
commit 12fb5d3b55
3 changed files with 279 additions and 9 deletions
+34
View File
@@ -2,6 +2,40 @@
Current date/time context: 2026-06-27, local timezone America/Chicago.
## 2026-06-27 Disabled Momentum Penalty Prototype
- Static disassembly of the full async solver relaxation cluster is updated.
`0x40ba58` has exactly four direct callers:
`0x40b175`, `0x40b4ac`, `0x40b6d5`, and `0x40bca7`.
- The ordinary adjacency walkers are still the clean first patch surface:
`0x40b304` reaches relax at `0x40b4ac`, and `0x40b540` reaches relax at
`0x40b6d5`. Both compute vanilla tentative `g` in `xmm6`, copy it to
`xmm3`, write `f = g + h` at `[rsp+0x20]`, and then call `0x40ba58`.
- Patch starts are `0x40b49a` for list A and `0x40b6c3` for list B. Each
replaces 23 bytes ending at the vanilla `0x40ba58` call and jumps to a
private executable cave. The cave reproduces the overwritten vanilla math,
adds a fixed nonnegative cost to `xmm6`, recomputes `f` from the penalized
`g`, calls vanilla `0x40ba58`, and jumps back after the overwritten block.
- Added a disabled-by-default RED4ext prototype in
`red4ext/EdgeWeightGPS/src/Main.cpp`:
`kEnableGpsMomentumPenaltyInlinePatch = false`,
`kGpsMomentumFixedEdgePenalty = 8.0f`.
- This first prototype is only a short-segment/churn lever. It adds a fixed
per-edge penalty on ordinary neighbor expansion, so routes that stair-step
through many small pieces become more expensive without making highways
cheaper. It does not yet compute turn angle, ramp transition cost, or
predecessor/current/neighbor geometry.
- The first prototype intentionally leaves the two non-ordinary relax paths
vanilla:
`0x40b175` appears to be a target/terminal candidate path, and `0x40bca7`
appears to be a special continuation/end-candidate path from `0x40bbbc`.
Patch them only after the ordinary expansion test proves stable.
- Build verification passed in toolbox:
`toolbox run -c 2077 ./tools/build_red4ext_shim.sh`.
- The prototype was not installed into the live game directory. To test later,
flip `kEnableGpsMomentumPenaltyInlinePatch` to `true`, rebuild, install only
after the game is cold, and compare against the fixed El Coyote route set.
## 2026-06-27 Routing Literature And Engine Research
- Added `docs/gps-routing-research.md` as the durable summary of the GPS