Commit Graph
330 Commits
Author SHA1 Message Date
Dusk-92 cc7a5dd7f9 Expose post-publication scan diagnostic 2026-08-28 20:15:54 +02:00
Dusk-92 57fa079361 Track scans occurring after Outline publication 2026-08-28 20:15:49 +02:00
Dusk-92 41a53ce388 Expose Outline handoff diagnostics 2026-08-28 20:11:40 +02:00
Dusk-92 50c1a0b508 Instrument Outline Lua-to-render handoff 2026-08-28 20:11:36 +02:00
Dusk-92 9f9e56e764 Use atomic Lua-to-render handoff for Outline target 2026-08-28 20:02:45 +02:00
Dusk-92 4e8791687b Capture and pin Outline objects from Lua thread 2026-08-28 19:59:30 +02:00
Dusk-92 d4df1143ce Use Lua-thread pinned objects for Outline debug rendering 2026-08-28 19:59:25 +02:00
Dusk-92 e0f8592015 Expose UnitGUID object-resolution stages 2026-08-28 19:56:28 +02:00
Dusk-92 8e6d8e292e Use working UnitGUID path for Outline tracking 2026-08-28 19:56:25 +02:00
Dusk-92 35f90c85fb Add one-shot UnitGUID diagnostics to OutlineDebug 2026-08-28 19:52:04 +02:00
Dusk-92 2aeee3fceb Expose player GUID stage in OutlineDebug 2026-08-28 18:31:15 +02:00
Dusk-92 6ef29ba99f Track target independently from local player resolution 2026-08-28 18:31:12 +02:00
Dusk-92 fb4fb880e5 Use Nampower-style player and target GUID path 2026-08-28 18:26:15 +02:00
Dusk-92 61cf447248 Add locked target GUID address for Outline debug 2026-08-28 18:26:11 +02:00
Dusk-92 1314860bde Let target Outline work without legacy object manager global 2026-08-28 18:22:12 +02:00
Dusk-92 134e5a37f9 Allow GUID resolution when legacy object manager global is zero 2026-08-28 18:21:59 +02:00
Dusk-92 bff19dd95b Show object manager readiness in OutlineDebug 2026-08-28 18:16:19 +02:00
Dusk-92 4eb37f4c23 Bypass broken IS_IN_WORLD gate in Outline debug 2026-08-28 18:16:14 +02:00
Dusk-92 3ee72d70d6 Add object manager readiness check for Outline debug 2026-08-28 18:16:10 +02:00
Dusk-92 b714c38ab7 Expose target acquisition stages in OutlineDebug 2026-08-28 18:06:19 +02:00
Dusk-92 bcf8cefb35 Split Outline target acquisition diagnostics 2026-08-28 18:06:15 +02:00
Dusk-92 33ec80d742 Register OutlineDebug Lua command 2026-08-28 17:57:19 +02:00
Dusk-92 ad706ccb9a Add in-game OutlineDebug diagnostics 2026-08-28 17:57:09 +02:00
Dusk-92 d7f93b3c00 Add sticky D3D9 Outline diagnostics 2026-08-28 17:56:47 +02:00
Dusk-92 62026da380 Add sticky Outline tracker diagnostics 2026-08-28 17:56:26 +02:00
Dusk-92 37757a2347 Fix V8 UnitGUID x86 ABI stack leak 2026-08-28 17:48:06 +02:00
Dusk-92 855ea340cc Fix V8 registerFunction asm build 2026-08-28 17:39:31 +02:00
Dusk-92 17af79dff4 Fix V8 FrameScript registration ABI 2026-08-28 17:37:45 +02:00
Dusk-92 126f617ca1 Fix V8 OutlineCommand ABI to receive Lua state in ECX 2026-08-28 17:27:24 +02:00
Dusk-92 dbdb513e94 Use x86 fastcall for OutlineCommand callback 2026-08-28 17:09:38 +02:00
Dusk-92 5fe9a92672 Force Outline Lua calls through x86 register asm 2026-08-28 17:04:59 +02:00
Dusk-92 bbcc70fa0d Fix Outline Lua API calls on safe core V5 2026-08-28 16:54:46 +02:00
Dusk-92 68c0ad2b75 Use minimal standalone core for Outline CustomAssets and TransmogFix 2026-08-28 16:46:54 +02:00
Dusk-92 f4cbacb7f9 Fix DllMain return type for Zig 0.16 2026-08-28 15:12:18 +02:00
MarcelineVQ 727a4cc229 Scrub remaining absolute machine paths from module docs 2026-08-01 18:04:54 -07:00
MarcelineVQ 1d41a029a8 Scrub local machine paths from docs
Replace absolute /home/august/... references with neutral placeholders and
drop TODO.md links to plan files that only exist locally.
2026-07-27 21:49:44 -07:00
MarcelineVQ b12fc820ef Publish source: Unlicense, public README, repo hygiene
The remote was previously a distribution-only point for pre-built DLLs.
This opens the source.

- LICENSE: Unlicense, with a GPL-3.0 carve-out for src/dpslog/WeirdDPSMate
  (a DPSMate fork that keeps its own license)
- README.md replaces the stale internal one with the user-facing docs from
  DLL_README.md, swapping the 'Why No Source Code?' section for build and
  layout notes. DLL_README.md is dropped; one README now serves both.
- RELEASING.md: drop the trim-the-README-per-release dance and the
  remote/WeirdUtils/ distribution clone, both obsolete now
- gitignore agent/editor scratch, build caches, the vendored WSBT addon,
  and the WeirdThreat/uwu-logs checkouts (separate upstream repos)
- Commit outstanding module work: superweirdo, clickthrough portal visuals,
  transform44 decompiles, worldmarkers demo presets, tools/
2026-07-27 21:47:55 -07:00
MarcelineVQ f500147fc7 weirdperformance: f64-intermediate bone transform to eliminate spell/doodad z-fighting
Adds bone_sse64.zig as an f64-intermediate port of transformMatrix4x4, used as
the active hook. M2 bone matrices are built and multiplied as [16]f64 and only
narrow to f32 on final store into the bone output buffer -- matching the x87
original's rounding profile (wide intermediates, single f32 store) and keeping
M2 vertex positions aligned with the terrain/projected-texture pipeline.

Also fixes, in both bone_sse (f32) and bone_sse64:

- Pre-billboard tx/ty/tz accumulation order (row 0 = pz+px+py; rows 1/2 = pz+py+px)
- Post-billboard pos_y/pos_z accumulation order (py+pz+px)
- Post-billboard scale-recompute accumulation order (row0 + row2 + row1)
- Billboard types 2/4 normalize using f64 intermediates (load-bearing for camera
  basis vectors -- pure f32 drifted from x87 by a ULP per axis and caused
  particle emitters to jitter on camera motion)

Additional bone_sse64-specific changes:

- Local attachmentRecursion64 that recurses into transformImpl_SSE64 instead of
  bone_sse.transformImpl_SSE, so attached child models stay on the f64 path
- child_padding (this+0x84) computed with f64 intermediates

bone_sse remains the reference f32 implementation; its struct fields, inline
helpers, and section-loop fns are now `pub` so bone_sse64 can share them
(types/interpolation helpers/post-loop loops). Artifact size is unchanged.

build.zig adds bench_bone_sse64 object; src/bench/main.zig runs the new variant
through the same warmup/timing harness and prints SSE vs SSE64 vs BASELINE
cycles plus a parity check.
2026-04-16 22:58:09 -07:00
MarcelineVQ 37c96eb577 worldmarkers: revert locale encoding -- not a real issue on Windows
C runtime starts in "C" locale (dot decimals) on all platforms.
WoW doesn't call setlocale. The integer encoding was unnecessary
and would break sync with older builds.
2026-04-13 13:49:53 -07:00
MarcelineVQ 6a3812a0ab worldmarkers: locale-safe coordinate encoding, clear markers on group leave
Addon messages now encode coordinates as integers (*1000) to avoid
locale-dependent decimal separators breaking cross-client sync.

DLL detects group leave via LEADER_GUID dropping to zero and clears
all markers locally -- no addon permission checks needed.
2026-04-13 13:37:09 -07:00
MarcelineVQ 83dda7b5ae silicon_sse: fix over-cull of straddling objects in frustumCullBBox
si_frustumCullBBox (0x686000, center+radius variant) was culling any
bounding volume whose center had view-space z < 0, but an object whose
center is behind the camera can still have its front extent inside the
frustum (think of standing next to a big WMO -- the building's center
can be a few units behind you while its front wall is still in frame).

Use the bounding sphere rather than the center point: only cull when
the closest point of the sphere is itself behind the camera, i.e.
center.z + |radius| < 0. Straddling cases now fall through to the
near-plane passthrough and get rendered.

si_frustumCullBBox8 (0x686180, 8-corner variant) already does the
right thing here -- it only returns "all behind" when every transformed
corner has z < 0, which is a true convex-hull test for an AABB.
2026-04-11 13:41:34 -07:00
MarcelineVQ 27b9254ab8 weirdperformance: consolidate luastr and luavm as sub-modules
Drop the top-level luastr and luavm module flags and wire both through
weirdperformance, matching the existing luaalloc/luagc sub-module pattern.
Also removes luavm's A/B rdtsc instrumentation now that the newlstr hash
pre-check is production-only.

 - build.zig: remove luastr/luavm from module_list
 - DLL_README.md: add Lua Runtime bullet under Performance, swap
   em/en-dashes for ASCII
 - src/luavm/: delete (files moved into src/weirdperformance/ which was
   already the tracked location in HEAD)
2026-04-11 13:21:51 -07:00
MarcelineVQ 039cec1806 luagc: 5.1 incremental GC with timing, stress tests, pre-alloc hooks (BROKEN)
Current state CRASHES on load due to pre-alloc hooks with wrong calling
conventions. pushcclosure hook is still enabled with partially disabled
others. Needs all pre-alloc hooks disabled or CCs fixed before use.

Implemented:
- Full 5.1 tri-color incremental GC
- 5.1-style singlestep budget loop (replaces chunk-based approach)
- Per-step rdtsc timing (ZGCStats returns max_step_us, atomic_us)
- Configurable gcstepsize/gcstepmul/gcpause via ZGCTune()
- Pre-alloc GC hooks for 7 API functions (5.1 luaC_checkGC pattern)
- Stress test addon: /gclife, /gcsweep, /gccompare

Broken:
- Pre-alloc hooks have CC mismatches causing immediate crash on load
- pushfstring is cdecl variadic, not fastcall (removed)
- pushstring has ambiguous CC (removed, covered by pushlstring)
- pushcclosure hook still active -- may be causing the crash
- Half-initialized objects cause garbage gcptr under heavy stress

weirdperformance: re-enabled luagc.install() + luastr + luavm
2026-04-11 13:03:37 -07:00
MarcelineVQ 8d3460cf1e luagc: per-step timing, forced GC honoring, weirdperformance compat
- Per-step rdtsc timing: ZGCStats returns max_step_us and atomic_us
- AllocBench /zgcstats frame shows step/atomic timing with color coding
- /gccompare command for timing forced GC cycles
- Honor lua_setgcthreshold forced collections (collectgarbage() with low
  threshold now triggers GC instead of being silently ignored)
- Disable luaalloc in weirdperformance when luagc is active (no conflict)
- Closures go to grayagain (covers all upvalue mutation paths)
2026-04-11 10:29:39 -07:00
MarcelineVQ ce5a2408d5 luagc: complete incremental GC -- no crashes, no addon errors on /reload
Closures, threads, and protos all go to grayagain for atomic re-traversal.
This covers all upvalue/stack/compiler mutations between mark steps without
needing to hook every individual write site.

Additional fixes this round:
- LUA_TUPVAL handling in markObject (5.1 reallymarkobject pattern)
- isCleared: strings never cleared from weak tables (5.1 lstring.c:337)
- Unified cleartable matching 5.1 (key OR value cleared removes entry)
- Clear stale weak flags when metatable is NULL
- lua_replace barrier hook (0x6F32B0) for upvalue pseudo-index writes
- Compiler barrier hooks (create_constant, finish_function) -- installed
  but superseded by proto grayagain
- fullgc abandon walks all objects with makewhite before restart
- Removed old separate clearWeakValues/clearWeakKeys

CHUNK_SIZE=5000, confirmed incremental: mark=46, sweep=184 on large heaps.
No crashes or addon errors through enter world, /reload, logout/login cycles.
2026-04-11 09:51:26 -07:00
MarcelineVQ a88d1f8411 luagc: complete Lua 5.1 incremental GC -- no crashes
Full 5.1 incremental GC port with CHUNK_SIZE=5000. All crash scenarios
resolved: enter world, logout/login, /reload, /gcstress.

Compiler barriers (verified from Ghidra):
- Hook lua_parser_create_constant (0x6FD400) and
  lua_parser_finish_function (0x6FCB00)
- ECX = LexState in all callers (not FuncState)
- Proto via: LexState+0x30 -> FuncState, FuncState+0x00 -> Proto
- Barrier-back: if proto is BLACK during mark, gray + grayagain

String/upvalue resurrection:
- Hook luaS_newlstr (0x6F9D00) -- resurrect dead strings from intern
- Hook luaF_findupval (0x6F9F10) -- resurrect dead open upvalues
- Birth mark patches for strings (0x6F9DC1) and upvalues (0x6F9F4A)

Other:
- Volatile reads/writes for all foreign memory access
- Fix upvalue traversal: dereference v pointer not inline value
- Remove bootstrap (luaC_link hook covers all objects except mainthread)
- Mainthread makewhite in markroot
- Remove 5.1 removeentry from traverseTable (5.0 tables don't expect TNONE)
- Clear stale weak flags when metatable is NULL
- fullgc abandon when lua_setgcthreshold forces GC mid-cycle

Remaining: /reload causes addon errors ("attempt to call a number value").
Not a crash -- investigation needed for the specific collection difference.
2026-04-10 23:58:50 -07:00
MarcelineVQ 72627d4123 luagc: complete 5.1 incremental GC integration -- string/upval resurrection
Critical fix: hook luaS_newlstr (0x6F9D00) for dead string resurrection
during incremental sweep. When the string intern table returns an existing
string with otherwhite (dead but not yet swept), flip its white bits to
resurrect it. Without this, code gets references to strings that sweep
will free, causing hash chain crashes. Matches 5.1 lstring.c:88.

Also:
- Upvalue resurrection: hook luaF_findupval (0x6F9F10), same pattern
- Upvalue birth mark: patch 0x6F9F4A so new open upvalues get currentwhite
- Volatile reads/writes on all memory accessors (foreign memory via @ptrFromInt)
- Fix upvalue traversal: dereference v pointer (+0x08) not inline value (+0x10)
- Fix upvalue birth mark address (0x6F9F4A not 0x6F9F48 -- immediate is last byte)
- Correct hook target: luaS_newlstr does intern lookup, not lua_create_string_object

CHUNK_SIZE=5000 (true incremental). Multi-step mark cycles confirmed working.
2026-04-10 15:30:56 -07:00
MarcelineVQ 1ec97731d5 luagc: fix upvalue value read (dereference v pointer, not inline offset)
Open upvalues have v pointing to the Lua stack. Closed upvalues have v
pointing to the inline copy at upval+0x10. Reading upval+0x10 directly
was wrong for open upvalues -- gave stale/garbage data, causing
markObject to be called with invalid pointers (e.g. 0x3).

Fix: dereference upval->v at +0x08 to get the actual TValue location.
Also: volatile reads on all readU8/readU32/writeU8/writeU32 (correct
for foreign memory access via @ptrFromInt).
2026-04-10 00:21:49 -07:00
MarcelineVQ e996796d39 luagc: Lua 5.1 tri-color GC with full forward barrier coverage
Major port of Lua 5.1 incremental GC patterns:

Tri-color system:
- Two-white (WHITE0/WHITE1) with currentwhite flip in atomic phase
- Objects born currentwhite via hooked luaC_link (0x6F7B20)
- String birth mark patched to currentwhite at each flip
- isDead: otherwhite check with FIXED exception for WoW
- makewhite on survivors (preserves KEYWEAK/VALUEWEAK/FIXED)
- Bootstrap: first cycle sets all existing objects to currentwhite

Mark system (5.1 reallymarkobject/propagatemark):
- Strings: stringmark inline (no gray stack)
- Userdata: go black inline, mark metatable
- Tables: gray2black, traverse, black2gray if weak
- Threads: NEVER black, always grayagain (re-traversed in atomic)
- Closures: go black normally

Forward barriers (5.1 luaC_barrierf at every write site):
- OP_SETUPVAL: VM patch at 0x6F8A97 with naked asm trampoline
- lua_setmetatable (0x6F4020): hooked, barrier on new metatable
- lua_setupvalue (0x6F47B0): hooked, barrier grays closure
- lua_setfenv (0x6F40D0): hooked, barrier grays object

Backward barriers (5.1 luaC_barrierback):
- lua_table_set_value (0x6FA840): black2gray + grayagain
- lua_table_set_int_key (0x6FAD80): black2gray + grayagain

Atomic phase (5.1 ordering):
- propagateall, re-traverse weak tables, mark running thread,
  grayagain drain, separateudata, marktmu, cleartable, flip white

Status: enters world successfully with CHUNK_SIZE=5000 (incremental).
Crashes on UI reload (different crash pattern -- NULL+8 deref in mark,
not the old hash chain crash). Progress from "crashes on enter world"
to "crashes on UI reload."
2026-04-09 23:50:37 -07:00
MarcelineVQ 54d1b69f0e luagc: incremental GC fixes (weak tables, isAlive, grayagain, lua_close)
- Weak tables mark strong dimension (condmarkobject pattern)
- isAlive matches WoW binary (raw marked != 0)
- Write barriers use grayagain (barrier-back, prevents livelock)
- removekey sets dead keys to LUA_TNONE
- lua_close hook resets GC state before teardown
- lua_setgcthreshold hook prevents threshold stomping
- Stack nilling in traverseThread
- Sweep order: rootudata -> strings -> rootgc
- Birth mark scoped to string sweep only
2026-04-09 17:25:13 -07:00