From 757790debe338ef32809815e4149655b94eacbab Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Wed, 30 Sep 2026 21:38:17 -0700 Subject: [PATCH] Keep large screen-space composites anchored as one group --- runtime/include/ws_hud_anchor.h | 4 +++- runtime/tests/test_ws_hud_anchor.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/runtime/include/ws_hud_anchor.h b/runtime/include/ws_hud_anchor.h index fc02cedc..2d035cae 100644 --- a/runtime/include/ws_hud_anchor.h +++ b/runtime/include/ws_hud_anchor.h @@ -9,7 +9,9 @@ extern "C" { #endif -#define WS_HUD_ANCHOR_TABLE_SIZE 256u +/* Large screen-space composites can exceed 256 packets (MMX6 Ilumina). + * Keep both pending display buffers' pieces anchored together. */ +#define WS_HUD_ANCHOR_TABLE_SIZE 4096u #define WS_HUD_ANCHOR_PROBES 8u #define WS_HUD_ANCHOR_FRESH_FRAMES 2u diff --git a/runtime/tests/test_ws_hud_anchor.c b/runtime/tests/test_ws_hud_anchor.c index fc91c5a3..5f3a7089 100644 --- a/runtime/tests/test_ws_hud_anchor.c +++ b/runtime/tests/test_ws_hud_anchor.c @@ -69,6 +69,18 @@ int main(void) { assert(!ws_hud_anchor_lookup(tags, WS_HUD_ANCHOR_TABLE_SIZE, 0x80010004u, packet, 4u, 20u, &anchor)); + /* Two pending 1000-piece composites, with MMX6's 40-byte packet stride. + * Losing early arm pieces splits Ilumina when world origin shifts. */ + for (uint32_t i = 0; i < 2000u; ++i) + ws_hud_anchor_insert(tags, WS_HUD_ANCHOR_TABLE_SIZE, + 0x10004u + i * 40u, 0, &guard, 30u + i / 1000u); + for (uint32_t i = 0; i < 2000u; ++i) { + anchor = 99; + assert(ws_hud_anchor_lookup(tags, WS_HUD_ANCHOR_TABLE_SIZE, + 0x10004u + i * 40u, packet, 4u, 31u, &anchor)); + assert(anchor == 0); + } + puts("ws_hud_anchor_test: PASS"); return 0; }