test(recompiler): check that APS5_NO_PERF_DISK_PLANS=1 is cache-neutral
APS5_NO_PERF_DISK_PLANS=1 is listed as a neutral switch, so it stays out of the variant key, and it exists to compare warm starts with and without stored plans. Nothing tested either property: the cross-process test ran with the switch unset only. A fourth child process now sets the switch against the cache the first process filled. It must run the front end for all 14 fixtures, neither load nor store a plan, still hit all 14 stored variants, and produce the same SPIR-V, bindings, push constants, snapshots, read traces and plans as the first process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a69f5e0371
commit
70663fec42
|
|
@ -1732,6 +1732,7 @@ std::filesystem::path planEntryPath(PlanFixture& fixture) {
|
|||
|
||||
int runPlanLoadingProcess(std::string_view mode) {
|
||||
if (mode == "--load-plan-switch") setEnvironment("APS5_TRACE_BINDLESS", "1");
|
||||
if (mode == "--load-plan-off") setEnvironment("APS5_NO_PERF_DISK_PLANS", "1");
|
||||
auto fixtures = planFixtures();
|
||||
const auto count = fixtures.size();
|
||||
std::vector<std::shared_ptr<const IrResourcePlan>> plans;
|
||||
|
|
@ -1747,6 +1748,8 @@ int runPlanLoadingProcess(std::string_view mode) {
|
|||
}
|
||||
if (mode == "--load-plan") {
|
||||
require(builds == 0u && totals.planHits == count && totals.planMisses == 0u && totals.planLoadFailures == 0u && totals.hits == count && totals.misses == 0u, "the second process ran the front end" + counts);
|
||||
} else if (mode == "--load-plan-off") {
|
||||
require(builds == count && totals.planHits == 0u && totals.planMisses == 0u && totals.planWrites == 0u && totals.hits == count && totals.misses == 0u, "APS5_NO_PERF_DISK_PLANS=1 used the stored plans or missed the stored variants" + counts);
|
||||
} else {
|
||||
require(builds == 1u && totals.planHits == count - 1u && totals.planLoadFailures == 1u && totals.planWrites == 1u && totals.hits == count && totals.misses == 0u, "the damaged plan was not rejected and rebuilt alone" + counts);
|
||||
}
|
||||
|
|
@ -1764,6 +1767,8 @@ int runPlanLoadingProcess(std::string_view mode) {
|
|||
const auto after = ShaderDiskCache::Totals();
|
||||
require(FrontEndBuilds() == 1u && after.planHits == count && after.planMisses == 1u, "a changed code word reused a stored plan");
|
||||
std::cout << "second process prepared " << count << " shaders from stored plans without running the front end\n";
|
||||
} else if (mode == "--load-plan-off") {
|
||||
std::cout << "APS5_NO_PERF_DISK_PLANS=1 ran the front end for all " << count << " shaders with the same output\n";
|
||||
} else {
|
||||
std::cout << "a damaged plan entry was rejected, rebuilt and stored again with the same output\n";
|
||||
}
|
||||
|
|
@ -1804,6 +1809,7 @@ void verifyPlanAcrossProcesses(const char* self) {
|
|||
require(std::system(command.c_str()) == 0, std::string("the process ") + mode + " failed");
|
||||
};
|
||||
run("--load-plan");
|
||||
run("--load-plan-off");
|
||||
std::vector<std::byte> entry;
|
||||
const auto damaged = planEntryPath(fixtures.front());
|
||||
require(ReadWholeFile(damaged, entry), "cannot read a stored plan entry");
|
||||
|
|
|
|||
Loading…
Reference in New Issue