Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,15 @@ set_tests_properties(startup_placement_publish_shrink_control PROPERTIES WILL_FA
# stops at the end of the buffer; every alias or refusal must equal the full walk's on the same memory,
# including a decommitted page before the buffer and a block replaced at the same base, and a large
# touched block must need no VirtualQuery (src/startup_stubs/placed_buffer_range.h). The mutated runs
# are the negative controls.
# are the negative controls; each passes only when it fails exactly for its stated reason.
add_executable(startup_placed_buffer_range_check tests/startup_placed_buffer_range_check.cpp)
target_compile_features(startup_placed_buffer_range_check PRIVATE cxx_std_17)
target_include_directories(startup_placed_buffer_range_check PRIVATE src)
add_test(NAME startup_placed_buffer_range COMMAND startup_placed_buffer_range_check)
add_test(NAME startup_placed_buffer_range_region_only_control COMMAND startup_placed_buffer_range_check --mutate region-only)
add_test(NAME startup_placed_buffer_range_walk_only_control COMMAND startup_placed_buffer_range_check --mutate walk-only)
set_tests_properties(startup_placed_buffer_range_region_only_control startup_placed_buffer_range_walk_only_control
PROPERTIES WILL_FAIL TRUE SKIP_RETURN_CODE 77)
PROPERTIES SKIP_RETURN_CODE 77)
add_executable(startup_storage_file_range tests/startup_storage_file_range.cpp)
target_compile_features(startup_storage_file_range PRIVATE cxx_std_17)
target_include_directories(startup_storage_file_range PRIVATE src)
Expand Down
5 changes: 3 additions & 2 deletions docs/startup-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -1947,8 +1947,9 @@ memory-type and state rules are unchanged. The five-second `x2w-d3d12 views note
between placements would show up as a mismatch. A 512 MiB committed block with one touched page per
64 KiB must be proven without any `VirtualQuery` call; the check prints the time per placement of
the full walk, the bounded walk and the proof. `_region_only_control` trusts the allocation size
without the committed-bytes check and must fail only in the partly committed cases;
`_walk_only_control` never uses the region information and must fail only that call count. A
without the committed-bytes check and passes only when its decisions differ in the partly committed
cases and nowhere else; `_walk_only_control` never uses the region information and passes only when
that call count is its sole failure. Neither is `WILL_FAIL`, so a crash cannot pass them. A
refused allocation or mapping is a capability skip (77) in the controls.

## Buffer memory SRVs (device slot 70)
Expand Down
11 changes: 6 additions & 5 deletions tests/startup_placed_buffer_range_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
// proof is printed.
//
// --mutate region-only trusts the allocation size without checking that every page is committed: it
// exits 1 only if decisions differ in the partly committed cases and nowhere else.
// --mutate walk-only never uses the region information: it exits 1 only if the call count of case 9
// fails and nothing else does. Either exits 0 otherwise, so its WILL_FAIL test fails. A refused
// allocation or mapping is a capability skip (77) in the controls and a failure in the main check.
// passes (exits 0) only if decisions differ in the partly committed cases and nowhere else.
// --mutate walk-only never uses the region information: it passes only if the call count of case 9
// fails and nothing else does. Either exits 1 otherwise. The controls are ordinary tests, not
// WILL_FAIL, so a crash or another failure cannot pass them. A refused allocation or mapping is a
// capability skip (77) in the controls and a failure in the main check.
#include "startup_stubs/placed_buffer_range.h"

#include <cstdio>
Expand Down Expand Up @@ -421,7 +422,7 @@ int main(int argc, char** argv)
std::fprintf(stderr, "placed buffer range control: failures other %d, partly committed %d, cost %d -> %s\n",
failures[other], failures[partial], failures[cost],
stated ? "failed for the stated reason" : "did NOT fail for the stated reason");
return stated ? 1 : 0;
return stated ? 0 : 1;
}
if (total || setup_failures) {
std::fprintf(stderr, "placed buffer range: %d failure(s), %d setup failure(s)\n", total, setup_failures);
Expand Down
Loading