Repository navigation
zink: clear resource lookup hints while retiring batch references - #1417
Conversation
Signed-off-by: DjDeveloperr <hey@djdev.me>
There was a problem hiding this comment.
Verdict: HOLD at e0a85e96
Blockers:
- Second GPU-generation row pending: per
Not yet, only MacBook Neo (J700, G17P B1) has been run ate0a85e96; a second GPU-generation row is pending before merge.
Checked:
- Audited
src/gallium/drivers/zink/zink_batch.c(+6/-2) against allbuffer_indices_hashlistreferences inzink_batch.c. - Verified
zink_create_batch_state()still initializes allBUFFER_HASHLIST_SIZEentries to-1, andreset_batch_state_internal()callsreset_obj()on every object across all six batch lists (real_objs,slab_objs,sparse_objs,unsync_objs,swapchain_obj_unsync,swapchain_obj), clearingbs->buffer_indices_hashlist[bo->unique_id & (BUFFER_HASHLIST_SIZE - 1)] = -1before releasing each BO reference. - Verified hash collisions remain safe via the existing
buffer_index < list->num_buffers && list->objs[buffer_index] == objcheck and linear fallback inbatch_find_resource(). - Exact-head MacBook Neo (J700, G17P B1, Zink on Borealis) row at
e0a85e96confirmed-6.55%depth-16 FIFO latency (18.709 -> 17.501 us),2,360/2,360GLES31 CTS Pass, 0 GPU faults;MERGEABLEagainstaurora-wip. Code is clean and ready to approve once the second GPU-generation row lands.
Evidence
- Head SHA:
e0a85e963c3c3a8dd8b632cb550008d380f44f1c(base=aurora-wip,MERGEABLE).
|
Review at What I checked:
What's left before merge: a hardware row at this head on a second GPU generation (G15 or G16). |
There was a problem hiding this comment.
Verdict: HOLD at 26c786fd
Blockers:
- Second GPU-generation hardware row remains pending before merge (
Not yet: only MacBook Neo J700G17P B1has been run so far).
Checked:
- Forward merge
26c786fdontoaurora-wip: zero conflicts and identical+6/-2diff insrc/gallium/drivers/zink/zink_batch.c(reset_obj()clearsbs->buffer_indices_hashlist[bo->unique_id & (BUFFER_HASHLIST_SIZE - 1)] = -1while retiring each referenced BO instead of a full 64 KiBmemsetinreset_batch_state_internal()). - Fresh batch states still initialize all buckets to
-1, andbatch_find_resource()retains its pointer check and fallback search.
Evidence
- Code remains clean with zero defects found; ready to approve once the second GPU-generation hardware row is posted.
|
J773g (M4 mini, T8132 G16G) peer row: parity. Zink d16 at The PR head is now
GLES31 conformance: 2,360 cases per arm (195 compute, 104 synchronization, 2,061 SSBO). Base and this PR both gave 2,360 Pass, 0 Fail, with identical case-by-case status. 0 GPU faults, driver warnings, recoveries or hang kills. |
There was a problem hiding this comment.
Verdict: MERGE at 26c786fd
Blockers: none.
Checked:
src/gallium/drivers/zink/zink_batch.c(+6/-2):reset_obj()clearsbs->buffer_indices_hashlist[bo->unique_id & (BUFFER_HASHLIST_SIZE - 1)] = -1while retiring each referenced BO instead of a full 64 KiBmemsetinreset_batch_state_internal(). Fresh batch states still initialize all buckets to-1, andbatch_find_resource()retains its pointer check and linear fallback search.- Forward merge
26c786fdontoaurora-wip: zero conflicts, zero diff vse0a85e96in Zink. - Dual GPU-generation hardware verification complete:
- MacBook Neo (
J700,A18 Pro,G17P B1):-6.55%paired latency reduction at depth-16 (18.709 -> 17.501 µs), all 2,360 GLES31 CTS cases passed (195 compute, 104 synchronization, 2,061 SSBO), 0 faults. - Mac mini M4 (
J773g,T8132,G16G): parity at depth-16 (35.246 -> 35.029 µs,-0.584%paired inside1.315%A/A drift across 4 A/B + 4 A/A qualified blocks), every slot's output/guard words/CRC verified, 0 GPU faults/recoveries/hangs.
- MacBook Neo (
Evidence
- Code independently verified clean; both GPU-generation hardware rows pass with zero faults or regressions. Ready to merge into
aurora-wip.
|
@DjDeveloperr, code-owner heads-up: App approval at |
What
Zink cleared a 64 KiB buffer-index table on every batch reset, even for a dispatch that references one storage buffer. Clear the occupied hash buckets as their buffer objects are released. Fresh batch states still initialize every bucket, and collisions retain the existing pointer check and fallback search.
Tested
MacBook Neo (J700, A18 Pro, G17P B1), stock Fedora 44 kernel
7.3.0-41.fc44.aurora.aarch64. Zink on Borealis, Mesa base89ddabbf72c251ff2eaabecb8ebf0ec4755a0269, heade0a85e963c3c3a8dd8b632cb550008d380f44f1c. Both arms loaded checksum-verified Gallium, EGL and Borealis libraries. The depth-16 FIFO went from 18.709 to 17.501 µs per completed dispatch, a 6.55% paired latency reduction.The checked
compute.lightfixture uses the GPUBench shader ata5409150182f9dd0f951ace2d009a832c3d449a1. Each process ranlight-gl DEPTH ratewith a 300 ms warmup and five 250 ms windows, then verified the output and guard words in every slot. The executor usedEGL_PLATFORM=surfaceless,MESA_LOADER_DRIVER_OVERRIDE=zink,MESA_SHADER_CACHE_DISABLE=trueand private EGL and Vulkan manifests. Both CPU policies were fixed at 2.472 and 1.464 GHz. Each qualified block held GPU P10 at 1.470 GHz through the timed windows. The application inherited its normal CPU mask.Each depth had four qualified A/B blocks alternating ABBA and BAAB and four matched base/base blocks. Latency change is the median of the blockwise ratios. The drift bound is the largest absolute matched base/base change.
The depth-1 and depth-2 increases remained inside their respective A/A bounds. Every retained timing row passed readback. Fixture source, exact commands, raw windows and scorer
The supplemental GLES31 CTS run on Zink passed all 2,360 cases on both arms with identical case statuses (195 compute, 104 synchronization and 2,061 SSBO). Every shard loaded its staged Gallium, EGL and Borealis libraries. The stock Neo returned with four SLC planes, zero failed units and zero GPU faults, kernel WARNs or AVCs.
Risk
The lookup table is a hint shared by the batch object lists. Batch reset visits every referenced object and clears its bucket before dropping the reference. Repeated and colliding keys can clear the same bucket more than once. Dense batches trade a contiguous clear for a store per retired reference.
Not yet
A second GPU-generation row is pending before merge.