diff --git a/.github/workflows/win_clang_dbg_x64.yaml b/.github/workflows/win_clang_dbg_x64.yaml index 825cadc16..21bf4380d 100644 --- a/.github/workflows/win_clang_dbg_x64.yaml +++ b/.github/workflows/win_clang_dbg_x64.yaml @@ -149,6 +149,12 @@ jobs: cd test out\Debug\gpgmm_capture_replay_tests.exe --log-level=DEBUG --gtest_output=json:${{ github.workspace }}\..\test_capture_replay_tests.json 2>&1 + - name: Run gpgmm_capture_replay_tests to re-capture (with patch) + shell: cmd + run: | + cd test + out\Debug\gpgmm_capture_replay_tests.exe -log-level=DEBUG --gtest_filter=*Replay/* --capture-mask=0x3 --ignore-caps-mismatch --disable-memory + - name: Regression check end2end tests run: | python test\scripts\regression_check.py ${{ github.workspace }}\..\baseline_end2end_tests.json ${{ github.workspace }}\..\test_end2end_tests.json diff --git a/.github/workflows/win_clang_rel_x64.yaml b/.github/workflows/win_clang_rel_x64.yaml index b1db8c11e..6e5d8d1fe 100644 --- a/.github/workflows/win_clang_rel_x64.yaml +++ b/.github/workflows/win_clang_rel_x64.yaml @@ -149,6 +149,12 @@ jobs: cd test out\Release\gpgmm_capture_replay_tests.exe --gtest_output=json:${{ github.workspace }}\..\test_capture_replay_tests.json + - name: Run gpgmm_capture_replay_tests to re-capture (with patch) + shell: cmd + run: | + cd test + out\Release\gpgmm_capture_replay_tests.exe --gtest_filter=*Replay/* --capture-mask=0x3 --ignore-caps-mismatch --disable-memory + - name: Regression check end2end tests run: | python test\scripts\regression_check.py ${{ github.workspace }}\..\baseline_end2end_tests.json ${{ github.workspace }}\..\test_end2end_tests.json diff --git a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp index 8a6b19b1e..204e787d6 100644 --- a/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp +++ b/src/tests/capture_replay_tests/D3D12EventTraceReplay.cpp @@ -186,7 +186,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith const Json::Value& args = event["args"]; ASSERT_FALSE(args.empty()); - if (envParams.IsAllocationPlaybackDisabled) { + if (envParams.IsAllocatorDisabled) { continue; } @@ -305,7 +305,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith << "Capture device does not match playback device (IsUMA: " + std::to_string(snapshot["IsUMA"].asBool()) + " vs " + std::to_string(mIsUMA) + ")."; - GPGMM_SKIP_TEST_IF(envParams.IsSameCapsRequired); + GPGMM_SKIP_TEST_IF(!envParams.IsIgnoreCapsMismatchEnabled); } RESIDENCY_DESC residencyDesc = {}; @@ -430,7 +430,7 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith std::to_string(snapshot["ResourceHeapTier"].asInt()) + " vs " + std::to_string(allocatorDesc.ResourceHeapTier) + ")."; - GPGMM_SKIP_TEST_IF(envParams.IsSameCapsRequired); + GPGMM_SKIP_TEST_IF(!envParams.IsIgnoreCapsMismatchEnabled); } ComPtr residencyManager; @@ -479,6 +479,10 @@ class D3D12EventTraceReplay : public D3D12TestBase, public CaptureReplayTestWith continue; } + if (envParams.IsMemoryDisabled) { + continue; + } + D3D12_HEAP_PROPERTIES heapProperties = {}; heapProperties.Type = static_cast( args["Heap"]["Properties"]["Type"].asInt()); @@ -587,8 +591,6 @@ TEST_P(D3D12EventTraceReplay, Replay) { // Verify that playback of a captured trace does not exceed peak usage. TEST_P(D3D12EventTraceReplay, PeakUsage) { TestEnviromentParams forceParams = {}; - forceParams.IsSameCapsRequired = true; - RunSingleTest(forceParams); EXPECT_LE(mReplayedMemoryStats.PeakUsage, mCapturedMemoryStats.PeakUsage); @@ -605,7 +607,6 @@ TEST_P(D3D12EventTraceReplay, AllowPrefetch) { // Verify no heap re-use through sub-allocation will succeed. TEST_P(D3D12EventTraceReplay, DisableSuballocation) { TestEnviromentParams forceParams = {}; - forceParams.IsSameCapsRequired = true; forceParams.IsSuballocationDisabled = true; RunSingleTest(forceParams); @@ -613,7 +614,7 @@ TEST_P(D3D12EventTraceReplay, DisableSuballocation) { EXPECT_LE(mReplayedMemoryStats.PeakUsage, mCapturedMemoryStats.PeakUsage); } -// Verify that playback with memory creation disabled will succeed. +// Verify that playback no memory created will succeed. TEST_P(D3D12EventTraceReplay, NeverAllocate) { TestEnviromentParams forceParams = {}; forceParams.IsNeverAllocate = true; @@ -623,13 +624,4 @@ TEST_P(D3D12EventTraceReplay, NeverAllocate) { EXPECT_LE(mReplayedMemoryStats.PeakUsage, 0u); } -// Playback captured trace into a new trace with capture-only events. -// Test must run last since the new trace will replace the old trace. -TEST_P(D3D12EventTraceReplay, Recapture) { - TestEnviromentParams forceParams = {}; - - forceParams.CaptureEventMask = EVENT_RECORD_FLAG_CAPTURE; - RunSingleTest(forceParams); -} - GPGMM_INSTANTIATE_CAPTURE_REPLAY_TEST(D3D12EventTraceReplay); diff --git a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp index eed217bf1..2d8b5b911 100644 --- a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp +++ b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.cpp @@ -85,8 +85,8 @@ GPGMMCaptureReplayTestEnvironment::GPGMMCaptureReplayTestEnvironment(int argc, c continue; } - if (strcmp("--same-caps", argv[i]) == 0) { - mParams.IsSameCapsRequired = true; + if (strcmp("--ignore-caps-mismatch", argv[i]) == 0) { + mParams.IsIgnoreCapsMismatchEnabled = true; continue; } @@ -95,8 +95,13 @@ GPGMMCaptureReplayTestEnvironment::GPGMMCaptureReplayTestEnvironment(int argc, c continue; } - if (strcmp("--disable-allocation-playback", argv[i]) == 0) { - mParams.IsAllocationPlaybackDisabled = true; + if (strcmp("--disable-allocation", argv[i]) == 0) { + mParams.IsAllocatorDisabled = true; + continue; + } + + if (strcmp("--disable-memory", argv[i]) == 0) { + mParams.IsMemoryDisabled = true; continue; } @@ -135,8 +140,8 @@ GPGMMCaptureReplayTestEnvironment::GPGMMCaptureReplayTestEnvironment(int argc, c << " --playback-file: Path to captured file to playback.\n" << " --same-caps: Captured device must be compatible with playback device.\n" << " --profile=[MAXPERF|LOWMEM|CAPTURED|DEFAULT]: Profile to apply.\n" - << " --disable-allocation-playback: Disable allocation playback for testing " - "budgets.\n"; + << " --disable-allocator: Disables allocator playback.\n" + << " --disable-memory: Disables playback of memory from capture.\n"; continue; } } @@ -159,16 +164,10 @@ void GPGMMCaptureReplayTestEnvironment::TearDown() { void GPGMMCaptureReplayTestEnvironment::PrintCaptureReplaySettings() const { gpgmm::InfoLog() << "Playback settings\n" "-----------------\n" - << "Iterations per test: " << mParams.Iterations << "\n" - << "Must use same caps: " << (mParams.IsSameCapsRequired ? "true" : "false") - << "\n" - << "No Allocations: " - << (mParams.IsAllocationPlaybackDisabled ? "true" : "false") << "\n"; + << "Iterations per test: " << mParams.Iterations << "\n"; gpgmm::InfoLog() << "Experiment settings\n" "-------------------\n" - << "Disable sub-allocation: " - << (mParams.IsSuballocationDisabled ? "true" : "false") << "\n" << "Profile: " << AllocatorProfileToString(mParams.AllocatorProfile) << "\n"; } @@ -221,8 +220,8 @@ void CaptureReplayTestWithParams::RunTestLoop(const TestEnviromentParams& forceP envParams.CaptureEventMask |= forceParams.CaptureEventMask; } - if (forceParams.IsSameCapsRequired != envParams.IsSameCapsRequired) { - envParams.IsSameCapsRequired |= forceParams.IsSameCapsRequired; + if (forceParams.IsIgnoreCapsMismatchEnabled != envParams.IsIgnoreCapsMismatchEnabled) { + envParams.IsIgnoreCapsMismatchEnabled |= forceParams.IsIgnoreCapsMismatchEnabled; } if (forceParams.Iterations != envParams.Iterations) { diff --git a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h index 88d38c80c..bed060c62 100644 --- a/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h +++ b/src/tests/capture_replay_tests/GPGMMCaptureReplayTests.h @@ -45,11 +45,12 @@ struct TestEnviromentParams { uint64_t Iterations = 1; // Number of test iterations to run. int CaptureEventMask = 0; - bool IsSameCapsRequired = false; // Caps of test device must match capture caps. + bool IsIgnoreCapsMismatchEnabled = false; // Test device must match capture caps. bool IsSuballocationDisabled = false; bool IsNeverAllocate = false; bool IsPrefetchAllowed = false; - bool IsAllocationPlaybackDisabled = false; // Disables creation of new allocations. + bool IsAllocatorDisabled = false; // Disables creation of new allocations. + bool IsMemoryDisabled = false; // Disables creation of captured heaps. AllocatorProfile AllocatorProfile = AllocatorProfile::ALLOCATOR_PROFILE_CAPTURED; // Playback uses captured settings.