Merge local/tests

Co-Authored-By: Claude Opus 5.5 <[email protected]>

# Conflicts:
#	crates/victory-gpu/src/indirect.rs
This commit is contained in:
local committed 2026-11-24 22:21:05 -06:00
commit 1367368074
6 files changed
+144 -32

No files matched your search

+12 -1
View File
@@ -1135,6 +1135,7 @@ mod tests {
/// driver is what a run with `VICTORY_INPLACE_PROBE=1` adds.
#[test]
fn warp_probe_opens_title_like_memory_and_the_gpu_sees_its_bytes() {
let _turn = crate::indirect::tests::warp_turn();
let Some(device) = warp() else { return };
if device.cast::<ID3D12Device13>().is_err() {
eprintln!("no ID3D12Device13 here: parts of an allocation cannot be opened");
@@ -1158,6 +1159,7 @@ mod tests {
/// whole is turned down without asking the host.
#[test]
fn warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset() {
let _turn = crate::indirect::tests::warp_turn();
let Some(device) = warp() else { return };
if device.cast::<ID3D12Device13>().is_err() {
return;
@@ -1178,7 +1180,16 @@ mod tests {
assert!(same((start + 16) as *const u8, &[0xa5; 64]), "the GPU's write is at the title's address");
drop(placed);
// Half of it decommitted: turned down, the host not asked.
assert_ne!(mem::VirtualFree(base.add(2 * K64).cast(), K64, mem::MEM_DECOMMIT), 0);
// The heap lets go of the pages a moment after its last
// reference, if the adapter is busy with other tests' work.
let gone = (0..500).any(|_| {
let done = mem::VirtualFree(base.add(2 * K64).cast(), K64, mem::MEM_DECOMMIT) != 0;
if !done {
std::thread::sleep(std::time::Duration::from_millis(10));
}
done
});
assert!(gone, "the heap keeps the pages");
assert!(matches!(place_part(&device, start, len), Err(None)));
mem::VirtualFree(base.cast(), 0, mem::MEM_RELEASE);
}