test(vulkan): keep one alloc of headroom in the dmabuf frame budget
The budget is 6 for 5 measured on radv, so another driver's import path does not fail perf-check; the semaphore retire is locked at 0 by its own test.
- commit
- dff8f48518b002f10236afe07711b9d1cb42dbe1
- author
- brice · · 2026-10-16 14:08 UTC
- parent
- 5d1d4d1
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +6 -4
M internal/adapters/vulkan/scene_perf_test.go +6 -4
| @@ -140,8 +140,10 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||
| 140 | 140 | // A steady frame that draws a client dmabuf also records the ownership | |
| 141 | 141 | // barriers (acquire and release) of its image, which allocate nothing. The | |
| 142 | 142 | // frame still allocates more than the SHM scene: importing the client's | |
| 143 | - | // read fence (about 5 per frame, measured 5.0; the semaphore retire is | |
| 144 | - | // typed and costs no closure). Skipped without a GPU or /dev/udmabuf. | |
| 143 | + | // read fence (measured 5.0 on radv; the semaphore retire is typed and costs | |
| 144 | + | // no closure, locked by TestRetireSemaphoreAllocatesNothing). The budget | |
| 145 | + | // keeps one alloc of headroom for drivers whose import path differs. | |
| 146 | + | // Skipped without a GPU or /dev/udmabuf. | |
| 145 | 147 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | |
| 146 | 148 | r, err := New(80, 32) | |
| 147 | 149 | if err != nil { | |
| @@ -182,8 +184,8 @@ func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | |||
| 182 | 184 | moved() | |
| 183 | 185 | allocs := testing.AllocsPerRun(20, moved) | |
| 184 | 186 | t.Logf("dmabuf Render: %.1f allocs/frame", allocs) | |
| 185 | - | if allocs > 5 { | |
| 186 | - | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=5 (syncFD path: %v; a driver without sync-file export takes another path)", allocs, r.syncFD) | |
| 187 | + | if allocs > 6 { | |
| 188 | + | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=6 (syncFD path: %v; a driver without sync-file export takes another path)", allocs, r.syncFD) | |
| 187 | 189 | } | |
| 188 | 190 | } | |
| 189 | 191 | ||
| @@ -140,8 +140,10 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||||
| 140 | // A steady frame that draws a client dmabuf also records the ownership | 140 | // A steady frame that draws a client dmabuf also records the ownership | ||
| 141 | // barriers (acquire and release) of its image, which allocate nothing. The | 141 | // barriers (acquire and release) of its image, which allocate nothing. The | ||
| 142 | // frame still allocates more than the SHM scene: importing the client's | 142 | // frame still allocates more than the SHM scene: importing the client's | ||
| 143 | - | // read fence (about 5 per frame, measured 5.0; the semaphore retire is | 143 | + | // read fence (measured 5.0 on radv; the semaphore retire is typed and costs |
| 144 | - | // typed and costs no closure). Skipped without a GPU or /dev/udmabuf. | 144 | + | // no closure, locked by TestRetireSemaphoreAllocatesNothing). The budget |
| 145 | + | // keeps one alloc of headroom for drivers whose import path differs. | |||
| 146 | + | // Skipped without a GPU or /dev/udmabuf. | |||
| 145 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | 147 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | ||
| 146 | r, err := New(80, 32) | 148 | r, err := New(80, 32) | ||
| 147 | if err != nil { | 149 | if err != nil { | ||
| @@ -182,8 +184,8 @@ func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | |||||
| 182 | moved() | 184 | moved() | ||
| 183 | allocs := testing.AllocsPerRun(20, moved) | 185 | allocs := testing.AllocsPerRun(20, moved) | ||
| 184 | t.Logf("dmabuf Render: %.1f allocs/frame", allocs) | 186 | t.Logf("dmabuf Render: %.1f allocs/frame", allocs) | ||
| 185 | - | if allocs > 5 { | 187 | + | if allocs > 6 { |
| 186 | - | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=5 (syncFD path: %v; a driver without sync-file export takes another path)", allocs, r.syncFD) | 188 | + | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=6 (syncFD path: %v; a driver without sync-file export takes another path)", allocs, r.syncFD) |
| 187 | } | 189 | } | ||
| 188 | } | 190 | } | ||
| 189 | 191 | ||||