3 Commits
Author SHA1 Message Date
Diego Casares c1d81790a3 Shaders: take a mask's lane bit by console lane in halves mode
A console wave64 compute program that runs as two host waves of 32
("halves") numbers its lanes through console_thread (thread_id does).
console_lane and lane_bit still read the host lane index unless
exchange is set. A 64-bit mask read as a number, such as a select on
an SGPR pair, then gave lanes 32-63 the bits of the low dword: their
host lane is 0-31, so the test `lane < 32` always picked the low dword.

Use the console lane in both places when halves is set, as exchange
already does.

(cherry picked from commit 245cb85145bfd083e3df6769adf68dbdbb670340)
2026-11-27 17:51:23 -08:00
Diego Casares 202d2853a9 fix(loader): prepare no longer overflows on RVAs past 4 GiB
prepare() added a relocation's page RVA to its in-page offset, and the
TLS callback field's RVA to the directory's RVA, with plain `+`. In a
malformed image either sum can pass u32::MAX: a debug build panics, and
a release build wraps to a wrong RVA. Skip a relocation target that has
no RVA, and treat a TLS field with no RVA as having no relocation to
clear.

(cherry picked from commit 95b990d39a07685b77a5f89492bb705d62d23bbc)
2026-11-27 17:51:23 -08:00
Diego Casares 4902d45680 hle: pending_with completes the call it began, not the block's
pending_with ran its work on a thread that completed the call by its block
address. A title that cancels the call and begins another on the same block
(zeroed, as a new block is) had the old work finish the new call. The thread
also read the shared state through a raw pointer that cleanup had already
freed when the cancel ended the call, so a result returned after a cancel
was a use-after-free.

The thread now holds an Arc of the state and the call it began with, and
completes that call directly. A call a cancel ended is left alone.

Adds a regression test for the stale completion and a test for the
successful path.

(cherry picked from commit d3fb9dc0df8133003b2777944cfef613f6546bff)
2026-11-27 17:51:23 -08:00