[iterate-4E] Stage 1'a: enable host-atomic ReservationTable in native mode

native_active is now folded into parallel_active, so XENIA_NATIVE_THREADS=1
(a) enables kernel.reservations (lwarx/stwcx route through the inter-thread
ReservationTable) and (b) sets kernel.parallel_active for the wall-clock
vsync/coordination paths.

Closes the PPCBUG-108 landmine flagged in the rework pressure-test: native
mode runs guest code on multiple host threads concurrently, so the legacy
per-PpcContext reservation fallback (which cannot observe cross-thread
stores) is incorrect. Previously pure-native (no --parallel) left the table
disabled — silently wrong in release, debug_assert in debug.

Gate GREEN 3/3 (golden byte-identical, native renders, stress no-deadlock).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-07-05 20:21:49 +02:00
parent 48e166579b
commit 19700736b8

View File

@@ -1031,7 +1031,15 @@ fn cmd_exec_inner(
let v = v.trim().to_ascii_lowercase();
v == "1" || v == "true" || v == "yes"
});
let parallel_active = parallel || parallel_via_env;
// iterate-4E: native-threads mode is a superset of parallel behavior (it
// delegates to the free-run executor and runs guest code on multiple host
// threads concurrently). Folding it into `parallel_active` is what enables
// the host-atomic ReservationTable below — MANDATORY under concurrency, else
// lwarx/stwcx on non-primary slots silently can't observe cross-thread
// stores (PPCBUG-108). Also flips `kernel.parallel_active` so the wall-clock
// vsync/coordination paths engage like `--parallel`.
let native_active = native_threads_enabled();
let parallel_active = parallel || parallel_via_env || native_active;
kernel.parallel_active = parallel_active;
// AUDIT-032: default is `KernelState::xaudio_tick_enabled = true` now
// that the dedicated worker eliminates HW-thread hijack regressions.