Triforce v0.9.0

Character tab, faster renderer defaults, HD rumble shipped, and the 11-30 bug pass: ending softlock below 60 fps, adult first-night lock, Intel Arc robust buffers, adult map, randomizer load order.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-30 20:55:14 -06:00
parent 8cb23131f9
commit 822ee913bc
86 changed files with 8128 additions and 438 deletions

View File

@@ -6,10 +6,13 @@ and dispatches on every card, read once into a static of maybe_split, so nothing
now RX_VK_CHUNK when set, else the RX_VK_LAB_AB knob chunk:<n> in its phases, else the driver's default: 120 for every driver
until the lab picks one. (11-26) The lab picked NVIDIA's: 240 (measured in the benchmark's four scenes); every other driver
keeps 120. NVIDIA's driver is the device's driver id (VK_DRIVER_ID_NVIDIA_PROPRIETARY, one id on Windows and Linux), not the
card's vendor: NVK, Dozen and Venus on an NVIDIA card keep 120.
card's vendor: NVK, Dozen and Venus on an NVIDIA card keep 120. (11-29) On NVIDIA's driver a part ends where the game ends its
render pass by default, Threaded rendering or not (barrier_rules.h part_pass_end_default, vk_replay.cpp pass_end_parts): the
counted 240 applies there with RX_VK_PART_PASS_END=0.
Compiles a driver against barrier_rules.h, lab_ab.h and the Vulkan headers and checks:
the default is 240 for NVIDIA's driver, and 120 for NVK, Dozen, Venus, RADV, AMD's, Intel's, any other driver id and none;
the pass-end parts are the default for NVIDIA's driver alone (by its id: not NVK, not any other, not none);
the rule's id for NVIDIA's driver is Vulkan's;
with no knob the size is what the old read gave, for 100,000 random texts of the variable (unset, 0, 120, negative, words,
any number) on random drivers, except unset on NVIDIA's driver (240): the default path splits where it split elsewhere;
@@ -18,7 +21,8 @@ Compiles a driver against barrier_rules.h, lab_ab.h and the Vulkan headers and c
default beside the measured knob chunk:120, and the pass-end parts' test (value_of("chunk", -1) < 0) true only outside it.
And reads vk_replay.cpp: maybe_split has no static size and asks part_draws() at each call, still returns for a size of 0 or
less and still counts ++part_work against it after the tail's test, and takes Threaded rendering's pass-end parts only
outside the knob's phases; part_draws reads the variable once and the knob at each call, asks the rule with the device's
outside the knob's phases; pass_end_parts turns them on by default with Threaded rendering or the rule (the device's driver
id), and its line says which; part_draws reads the variable once and the knob at each call, asks the rule with the device's
driver id (no platform test) and says when Threaded rendering's parts decide instead; barrier_rules.h's comment names NVK,
Threaded rendering's parts and both measurements; the switches table has the row, with NVK, the measured PC, where the size
applies under Threaded rendering and a lab example against 120, and no longer says the in-pass split is on with NVIDIA's
@@ -67,6 +71,13 @@ int main() {
for (const auto& d : kDrivers) CHECK(d.what, br::part_draws_default(d.driver) == d.want);
static_assert(br::kDriverNvidiaProprietary == VK_DRIVER_ID_NVIDIA_PROPRIETARY, "the rule's id for NVIDIA's driver is Vulkan's");
CHECK("the constants", br::kPartDraws == 120 && br::kPartDrawsNvidia == 240);
// ((Triforce, 11-29) the pass-end parts by default, Threaded rendering off: NVIDIA's driver alone, by its id (the drivers
// that run on NVIDIA's cards beside it keep the parts cut by count, as every other driver, until the lab has measured them)
for (const auto& d : kDrivers)
CHECK("the pass-end parts by default on NVIDIA's driver alone", br::part_pass_end_default(d.driver) == (d.driver == VK_DRIVER_ID_NVIDIA_PROPRIETARY));
CHECK("the pass-end parts by default: NVIDIA's driver", br::part_pass_end_default(VK_DRIVER_ID_NVIDIA_PROPRIETARY));
CHECK("the pass-end parts not by default: NVK", !br::part_pass_end_default(VK_DRIVER_ID_MESA_NVK));
CHECK("the pass-end parts not by default: no driver id", !br::part_pass_end_default(0));
// with no knob: the old read, whatever the variable says
uint64_t rng = 0xD1B54A32D192ED03ull;
@@ -130,6 +141,14 @@ def function(text, head):
return text[at:text.index("\n}\n", at)]
def in_order(text, needles, where):
at = 0
for n in needles:
i = text.find(n, at)
check(i >= 0, "%s: %r missing or out of order" % (where, n))
at = i + len(n)
def check_source():
replay = (ROOT / "gpu/vk/vk_replay.cpp").read_text(encoding="utf-8")
split = function(replay, "void maybe_split(VkCommandBuffer& cmd) {")
@@ -158,8 +177,13 @@ def check_source():
# ((Triforce) and once by Threaded rendering's parts, only to step aside when it is set: pass_end_parts)
ends = function(replay, "PassEndParts& pass_end_parts() {")
check(replay.count('getenv("RX_VK_CHUNK")') == 2 and ends.count('getenv("RX_VK_CHUNK")') == 1, "RX_VK_CHUNK is read somewhere else")
check('v.on = e && *e ? atoi(e) != 0 : threaded_on() && !getenv("RX_VK_CHUNK");' in ends,
check('v.on = e && *e ? atoi(e) != 0 : by_default && !getenv("RX_VK_CHUNK");' in ends,
"pass_end_parts' switch changed: the docs say any RX_VK_CHUNK turns Threaded rendering's parts off")
# ((Triforce, 11-29) and NVIDIA's driver has them by default, Threaded rendering or not: the rule asked with the driver id)
check("const bool by_default = threaded_on() || barrier_rules::part_pass_end_default((uint32_t)dev.driver_id);" in ends,
"pass_end_parts' default is not Threaded rendering or the rule's, by the device's driver id")
check('"NVIDIA\'s driver\'s default since 11-29"' in ends and '"Threaded rendering"' in ends,
"pass_end_parts' line does not say why the pass-end parts are on")
check("every RX_VK_CHUNK, as before" not in ends and "default 120;" not in replay,
"vk_replay.cpp still says the counted size is 120 as before")
rules = (ROOT / "gpu/vk/barrier_rules.h").read_text(encoding="utf-8")
@@ -181,8 +205,38 @@ def check_source():
check("(the first part from 32)" in row[0] and "whole submissions" in there,
"the RX_VK_CHUNK row does not say Threaded rendering's first part is from 32 draws, or that RX_VK_CHUNK=0 there gives "
"whole submissions")
# ((Triforce, 11-29) the pass-end parts' own row: its default on NVIDIA's driver, the way back, and where it was measured)
pe = [line for line in dev.splitlines() if line.startswith("| `RX_VK_PART_PASS_END=0` or `=1`,")]
check(len(pe) == 1 and "**on by default on NVIDIA's driver since 11-29**" in pe[0] and "part_pass_end_default" in pe[0] and
"`=0`: counted parts" in pe[0] and "Not measured:" in pe[0] and "RTX 5090" in pe[0],
"docs/development.md: no row for RX_VK_PART_PASS_END with its default on NVIDIA's driver, =0 and where it was measured")
check("parts of 120 draws" not in dev, "docs/development.md still says a part is 120 draws on every card")
check("Unset: `pass` with NVIDIA's driver" not in dev, "docs/development.md still says the in-pass split is on with NVIDIA's driver")
# ((Triforce, 11-29) RX_VK_PART_IDLE / the knob partidle: a part after the first may end from the idle size once the GPU has
# done everything sent. Off unset; asked through part_min_now in place of pe.min, so maybe_split's control flow (and its
# renderer profile) is the same; the GPU looked at every 8th draw at most, below RX_VK_PART_MIN only)
check('v.idle = std::clamp<int64_t>(num("RX_VK_PART_IDLE", 0), 0, v.min);' in ends, "RX_VK_PART_IDLE is not off unset and at most PART_MIN")
split = function(replay, "void maybe_split(VkCommandBuffer& cmd) {")
check("const int64_t need = rec_parts == 0 && pe.first ? pe.first : part_min_now(pe);" in split,
"maybe_split does not ask part_min_now for a later part's size in place of pe.min")
pm = function(replay, "int64_t part_min_now(PassEndParts& pe) {")
# (and RX_VK_PART_RB / partrb: a part that writes back a page the CPU reads back, below PART_MIN only; the binding notes it
# through a call, so the binding's control flow (and its profile) is the same; cleared at each part's end)
# ((11-29, the owner's decision) 32 unset with RX_VK_RB_REC_END=3, the default with these parts; off with another mode set)
check('v.rb = std::clamp<int64_t>(num("RX_VK_PART_RB", range ? 32 : 0), 0, v.min);' in ends,
"RX_VK_PART_RB is not 32 unset with mode 3 (off with another) and at most PART_MIN")
mem = (ROOT / "gpu/vk/vk_memory.cpp").read_text(encoding="utf-8")
bind = function(mem, "BufferRef gpu_buffer_bind(uint64_t gpu, uint64_t size, bool written) {")
check("rb_write_note(p->lo + off, p->lo + wb_end);" in bind and "rb_watched(" not in bind and "part_rb_write" not in bind,
"gpu_buffer_bind does not note a read-back page's write-back through rb_write_note alone (a branch there loses its profile)")
check("part_rb_write.store(false, std::memory_order_relaxed);" in function(mem, "void memory_end_submission(VkCommandBuffer cmd) {"),
"a part's end does not clear the read-back write note")
in_order(pm, ['const int64_t rb = lab_ab::value_of("partrb", pe.rb);',
"if (rb > 0 && n >= rb && n < pe.min && memory_part_rb_write()) {", "return rb;",
'lab_ab::value_of("partidle", pe.idle);', "if (idle <= 0 || n < idle) {", "return pe.min;",
"if (part_idle_now) return idle;", "if (n >= pe.min || (n & 7) != 0 || !rec_timeline) return pe.min;",
"vkGetSemaphoreCounterValue(dev.device, rec_timeline, &done) == VK_SUCCESS && done >= rec_seq;"],
"part_min_now (off at 0, kept for the part once seen, the GPU looked at every 8th draw below PART_MIN)")
def main():