Document full GPS solver lead

This commit is contained in:
2026-06-26 22:45:14 -05:00
parent 7c2ef33952
commit 165bb661f1
3 changed files with 302 additions and 17 deletions
+72 -12
View File
@@ -6,8 +6,8 @@ Current date/time context: 2026-06-26, local timezone America/Chicago.
- Installed RED4ext state is safe: the game plugin directory contains
`EdgeWeightGPS.dll.disabled`, not an active `EdgeWeightGPS.dll`.
- Latest committed safe source before this update: `55f4087 Document VAND GPS
search graph`.
- Latest committed source before this handoff update:
`7c2ef33 Hook full GPS solver node weights`.
- Current source has `kEnableGpsTrafficEdgeWeightPatch = false` and
`kEnableGpsLocalSearchHooks = false`.
- The real route search is confirmed at `0x44f054`, called from
@@ -105,18 +105,74 @@ Important caveat:
## Current Installed State
- Installed RED4ext plugin is disabled:
`Cyberpunk 2077/red4ext/plugins/EdgeWeightGPS/EdgeWeightGPS.dll.disabled`.
- The latest tested DLL is also preserved disabled as:
`Cyberpunk 2077/red4ext/plugins/EdgeWeightGPS/EdgeWeightGPS.dd1423b.dll.disabled`.
- There is no active `EdgeWeightGPS.dll` in the plugin directory.
- Source defaults are currently read-only for route behavior again:
`kEnableGpsSpatialEdgeWeightPatch = false`. Focused final-route result tracing
remains available behind `kEnableGpsQueryResultTraceHooks = true`.
- Active RED4ext test plugin is installed:
`Cyberpunk 2077/red4ext/plugins/EdgeWeightGPS/EdgeWeightGPS.dll`.
- Older DLLs are preserved disabled as:
`Cyberpunk 2077/red4ext/plugins/EdgeWeightGPS/EdgeWeightGPS.dll.disabled`
and `EdgeWeightGPS.dd1423b.dll.disabled`.
- Source defaults now enable the full async solver multiplier hook:
`kEnableGpsMultiplierHooks = true`.
- The current behavior patch is deliberately narrow and diagnostic:
`DetourGpsNodeMultiplier` hooks native `0x40bb40`, applies only when
`job+0xc4 == 2` (driving route mode), reads lane/node flags from
`node+0x88`, and multiplies vanilla node edge cost by highway `0.35`,
GPSOnly `1.10`, pavement `1.25`, and all other flags `1.0`.
- `0x40bb00` auxiliary/reverse multiplier is hooked only for signature logging;
it is not patched yet.
- The plugin log was truncated immediately before installing this build.
- Latest archived test log:
`logs/EdgeWeightGPS_spatial_inversion_no_route_change_1845.log`.
- Game is cold as of the latest user message.
## 2026-06-26 Full Async Solver Findings
- Static route pipeline:
`0x8d20d4` map route submit -> `0x70a42c` query manager ->
`0x70a570` dispatch -> `0x8d17d8`/`0x8d1880` async enqueue.
- Worker loop around `0x126c06` consumes queued route requests from
`routeSystem+0x47c0`.
- Worker calls either `0x818928` directly or calls `0x883cd8` first, then
`0x818928`. Successful results pass through `0x11f5f60`.
- `0x883cd8` resolves/projects start and end candidates with helpers including
`0x198fb8`, `0x886958`, and `0x197b04`, then calls `0x1caa7a0`.
- `0x1caa7a0` initializes the full async traffic solver: it sets
`solver+0x10 = 1`, stores route mode at `solver+0xc4`, sets route masks at
`solver+0xc0/+0xc2`, copies candidate arrays into `solver+0x70/+0x80`, and
calls `0x88367c`.
- `0x88367c` marks start candidate lane/node records with `node+0x9a |= 1`,
marks end candidates with `node+0x9a |= 2`, computes initial costs at
node-state `+0x10/+0x14`, and queues nodes into open list `solver+0xd0`.
- `0x818928` calls `0x8189f0`; when complete, `0x818ba8` builds the output
route records.
- `0x8189f0` advances with `0x40ade4`, then materializes output with
`0x818ba8`.
- `0x40ade4` is the true full-route solver advance loop. It pops items from
`solver+0xd0` while `solver+0xdc != 0`, calls expansion helpers including
`0x40b304` and `0x40b540`, then marks state byte `+0x22 = 2`.
- `0x40b304` and `0x40b540` expand neighbor lists from lane/node records at
`solver+0xf8 + index*0xa0`.
- Neighbor admissibility is `0x40b774`, which checks flags at `node+0x88`:
pass iff `(solver+0xc0 & flags88) != 0` and
`(solver+0xc2 & flags88) == 0`.
- Main cost formula in `0x40b304`:
`g = current.g + delta * 0x40bb40(solver,node) * directionMultiplier`;
heuristic is straight-line distance to the solver target position; `f = g+h`.
- `0x40ba58` is the relax/update helper. It writes candidate `f` to node-state
`+0x14`, `g` to `+0x10`, progress to `+0x18`, predecessor state to `+0x1e`,
marks state byte `+0x22 = 1`, and pushes to open list `solver+0xd0`.
- Vanilla `0x40bb40` is the key full-solver per-node multiplier. For driving
modes it treats `Road` (`0x0010`) as `1.0` or `1.2`, with an extra `1.1`
multiplier if byte `node+0x93 == 1`. It does not special-case `Highway`
(`0x4000`).
- Vanilla non-road fallback uses the float table at `0x3154d28`:
`10, 6, 2, 0, 4, 2.5, 1.5, 0`.
- Vanilla `0x40bb00` auxiliary multiplier returns `1.1` for most road cases,
or uses the table at `0x3154d38` (`4, 2.5, 1.5, 0`) for one mode-2/retry
branch.
- Practical inference: the full solver already has a real edge-cost surface,
but vanilla highways are merely roads. The installed build patches that exact
multiplier instead of the earlier local VAND search callback.
## New Toolbox Tools
The Fedora toolbox `2077` now has:
@@ -132,6 +188,7 @@ instead of one-off pip installs.
In `red4ext/EdgeWeightGPS/src/Main.cpp`:
- `kEnableGpsMultiplierHooks = true`
- `kEnableGpsProviderClassPatch = false`
- `kEnableGpsProviderClassPatchTrace = false`
- `kEnableGpsTraceHooks = true`
@@ -143,8 +200,9 @@ In `red4ext/EdgeWeightGPS/src/Main.cpp`:
- `kEnableGpsLocalSearchHooks = false`
- `kEnableRouteUiTraceHooks = false`
If rebuilt with the current defaults, active hooks are focused map-route submit
and final route-result fetch tracing only. The spatial edge-cost patch requires
If rebuilt with the current defaults, active hooks are focused map-route submit,
final route-result fetch tracing, and the full solver multiplier hook at
`0x40bb00`/`0x40bb40`. The spatial edge-cost patch requires
`kEnableGpsSpatialEdgeWeightPatch = true`. The full local search/cost hooks below require
`kEnableGpsLocalSearchHooks = true`:
@@ -159,6 +217,8 @@ and final route-result fetch tracing only. The spatial edge-cost patch requires
- `GPSEdgeCost 0x44f838`
- filtered provider filter `0x44ff68`
- base provider filter `0x450b08`
- full solver auxiliary multiplier `0x40bb00`
- full solver node multiplier `0x40bb40`
Async route-job hooks (`0x8d17d8`, `0x126b28`, `0x883cd8`,
`0x11f5f60`, `0x818ba8`) are split behind