test(vulkan): explain the dmabuf alloc budget and report the sync path
- commit
- d55622625bd5bd0b280f43c5a5362f3d2735d734
- author
- brice · · 2026-10-13 18:33 UTC
- parent
- 0f2ac29
- 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
| @@ -42,7 +42,7 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||
| 42 | 42 | } | |
| 43 | 43 | frame() | |
| 44 | 44 | if allocs := testing.AllocsPerRun(20, frame); allocs > 3 { | |
| 45 | - | t.Errorf("small steady-state Render: %.1f allocs/frame, want <=3", allocs) | |
| 45 | + | t.Errorf("small steady-state Render: %.1f allocs/frame, want <=3 (syncFD path: %v)", allocs, r.syncFD) | |
| 46 | 46 | } else { | |
| 47 | 47 | t.Logf("small steady-state Render: %.1f allocs/frame", allocs) | |
| 48 | 48 | } | |
| @@ -138,8 +138,10 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||
| 138 | 138 | } | |
| 139 | 139 | ||
| 140 | 140 | // A steady frame that draws a client dmabuf also records the ownership | |
| 141 | - | // barriers (acquire and release) of its image: no allocation per frame beyond | |
| 142 | - | // the SHM scene's. Skipped without a GPU or /dev/udmabuf. | |
| 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 | |
| 143 | + | // read fence and its retire closure (about 4 per frame). Skipped without a | |
| 144 | + | // GPU or /dev/udmabuf. | |
| 143 | 145 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | |
| 144 | 146 | r, err := New(80, 32) | |
| 145 | 147 | if err != nil { | |
| @@ -181,7 +183,7 @@ func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | |||
| 181 | 183 | allocs := testing.AllocsPerRun(20, moved) | |
| 182 | 184 | t.Logf("dmabuf Render: %.1f allocs/frame", allocs) | |
| 183 | 185 | if allocs > 7 { | |
| 184 | - | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=7", allocs) | |
| 186 | + | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=7 (syncFD path: %v; a driver without sync-file export takes another path)", allocs, r.syncFD) | |
| 185 | 187 | } | |
| 186 | 188 | } | |
| 187 | 189 | ||
| @@ -42,7 +42,7 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||||
| 42 | } | 42 | } | ||
| 43 | frame() | 43 | frame() | ||
| 44 | if allocs := testing.AllocsPerRun(20, frame); allocs > 3 { | 44 | if allocs := testing.AllocsPerRun(20, frame); allocs > 3 { | ||
| 45 | - | t.Errorf("small steady-state Render: %.1f allocs/frame, want <=3", allocs) | 45 | + | t.Errorf("small steady-state Render: %.1f allocs/frame, want <=3 (syncFD path: %v)", allocs, r.syncFD) |
| 46 | } else { | 46 | } else { | ||
| 47 | t.Logf("small steady-state Render: %.1f allocs/frame", allocs) | 47 | t.Logf("small steady-state Render: %.1f allocs/frame", allocs) | ||
| 48 | } | 48 | } | ||
| @@ -138,8 +138,10 @@ func TestRenderSteadyStateAllocations(t *testing.T) { | |||||
| 138 | } | 138 | } | ||
| 139 | 139 | ||||
| 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: no allocation per frame beyond | 141 | + | // barriers (acquire and release) of its image, which allocate nothing. The |
| 142 | - | // the SHM scene's. Skipped without a GPU or /dev/udmabuf. | 142 | + | // frame still allocates more than the SHM scene: importing the client's |
| 143 | + | // read fence and its retire closure (about 4 per frame). Skipped without a | |||
| 144 | + | // GPU or /dev/udmabuf. | |||
| 143 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | 145 | func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | ||
| 144 | r, err := New(80, 32) | 146 | r, err := New(80, 32) | ||
| 145 | if err != nil { | 147 | if err != nil { | ||
| @@ -181,7 +183,7 @@ func TestRenderSteadyStateDMABufAllocations(t *testing.T) { | |||||
| 181 | allocs := testing.AllocsPerRun(20, moved) | 183 | allocs := testing.AllocsPerRun(20, moved) | ||
| 182 | t.Logf("dmabuf Render: %.1f allocs/frame", allocs) | 184 | t.Logf("dmabuf Render: %.1f allocs/frame", allocs) | ||
| 183 | if allocs > 7 { | 185 | if allocs > 7 { | ||
| 184 | - | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=7", allocs) | 186 | + | t.Errorf("dmabuf steady-state Render: %.1f allocs/frame, want <=7 (syncFD path: %v; a driver without sync-file export takes another path)", allocs, r.syncFD) |
| 185 | } | 187 | } | ||
| 186 | } | 188 | } | ||
| 187 | 189 | ||||