Repository navigation
perf(vulkan2d): upload the font atlas once per flush; css-layout 3 submits -> 1 - #633
Merged
Merged
Conversation
…ayout's two extra submits
(a) The typed atlas upload is now PARKED and drained immediately before the
submit instead of copying the full 4 MiB atlas once per text run. Within a
flush the atlas only grows (cells are inserted, never relocated -- the
invariant WRITE_IN_PLACE already rests on) and every dispatch that reads it is
recorded into the same not-yet-submitted command buffer, so the final copy is
observationally identical to the fifteen it replaces. A park aimed at a
different buffer drains the previous one first; release paths discard a park
rather than drain into a doomed buffer; a failed drain poisons only that slot.
The byte fallback lane is untouched.
(b) css-layout.html's submits_per_frame=3 had two causes, both found with the
tagged SIMPLE_VK_ORDER_TRACE flush trace (a new, permanently armed `font-slot`
line records the whole slot decision):
* a zero-area opaque rect reached the device arm, produced 0 workgroups, and
the enqueue's silent argument reject was read as the M4 bind-chain flake --
costing a full flush, a futile retry with the same arguments, and a CPU
fallback latch. Guarded at the call site and, generally, in
_dispatch_framebuffer_checked (dispatch-reject: no flush, no retry).
* a relocating WRITE_FRESH left the owner's name on its OLD slot at a stale
sequence; the first-match lookup then found the stale one forever and the
table exhausted into a FLUSH_THEN_WRITE. A write now disowns every other
slot naming that owner, and the slot table is 8 deep (an owner folds point
SIZE into its identity, so css-layout presents five owners from two
families).
Gate evidence, same binary (39528776/1789199850), digests unchanged:
overview.html uploads 23->13, upload_ms 43->19, submits 1, digest a15c50cd, PASS
css-layout.html uploads 47->25, upload_ms 57->32, submits 3->1, fences 3->1,
digest 743c2081, FAIL->PASS
Specs green (simple run): slot_plan 12/12, font_typed_upload 4/4,
quad_partition 7/7, drawing 44/44. Four sibling vulkan specs report
outcome=ERROR executed=0 from a pre-existing unresolved `use gpu.engine2d.*`
import in the spec files; unrelated to these sources.
Record: doc/08_tracking/bug/vulkan_font_atlas_reupload_per_run_and_css_layout_submits_2026-09-12.md
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TVraTPgGDVypESTsVqXPgi
…into the push tier Both landed with no hook and no CI job invoking them, so check-guard-wiring reported them as the only 2 NEW unwired guards on origin/main. They are the same shape as the already-wired rect-batch and blit pin gates: ~1s, no device, fail-closed with their own 4-fixture selftest, and both PASS today. Added as blocking push-tier manifest rows with byte-matching dispatch arms. Divergence-delta step-over recorded: PASS — 3209 pre-existing offender(s), 0 introduced by this range (base verdict FAIL 3943 diverged vs 965 baselined is pre-existing on origin/main). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TVraTPgGDVypESTsVqXPgi
ormastes
temporarily deployed
to
self-review-admission
September 12, 2026 11:22 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GPU-boundary audit gate had two residuals on the Vulkan web-renderer lane.
(a) The font atlas was copied to the device once per text run. Each run that
inserts a glyph bumps the owner's published sequence, so the slot plan is
WRITE_IN_PLACE, and that branch copied the full 1024x1024 atlas (4 MiB) everytime — ~15 copies, ~60 MB, on a page with one atlas. All but the last are dead:
within a flush the atlas only grows (cells are inserted, never relocated — the
invariant
WRITE_IN_PLACEalready rests on), and every dispatch that reads it isrecorded into the same not-yet-submitted command buffer. The typed (
u32) lanenow parks the copy and drains it immediately before the submit. A park aimed
at a different buffer drains the previous one first; release paths discard a park
rather than drain into a doomed buffer; a failed drain poisons only that slot.
The byte fallback lane is unchanged.
(b)
css-layout.htmlreportedsubmits_per_frame=3. Two causes, both foundwith the tagged
SIMPLE_VK_ORDER_TRACEflush trace (a permanently armedfont-slotline now records the whole slot decision):enqueue's silent argument reject was read as the measured M4 bind-chain flake,
costing a full flush (an extra submit), a futile retry with the same invalid
arguments, and a CPU-fallback latch. Guarded at the call site and, generally,
in
_dispatch_framebuffer_checked(dispatch-reject: no flush, no retry).WRITE_FRESHleft the owner's name on its OLD slot at a stalesequence; the first-match lookup found the stale one forever and the table
exhausted into a
FLUSH_THEN_WRITE. A write now disowns every other slotnaming that owner, and the table is 8 deep (an owner folds point SIZE into its
identity, so css-layout presents five owners from two families).
Evidence — audit gate, same binary (
39528776 1789199850)frame_digestidentical on both pages is the pixel oracle;cpu_fallback_count=0on both.
Specs (
simple run): slot_plan 12/12, font_typed_upload 4/4, quad_partition 7/7,drawing 44/44. Four sibling vulkan specs report
outcome=ERROR executed=0from apre-existing unresolved
use gpu.engine2d.engine.{Engine2D}(E1034) in thespec files — unrelated to these sources.
Guards: conflict-markers PASS, tree-size PASS, rt-dual-implementation PASS
(2519/2519), all four
*-spirv-pinnedPASS, guard-wiring PASS after the secondcommit wires the two orphaned SPIR-V pin gates (blur-rect, glass-material) that
were the only NEW unwired guards on
main. Divergence-delta: PASS — 3209pre-existing offenders, 0 introduced.
Record:
doc/08_tracking/bug/vulkan_font_atlas_reupload_per_run_and_css_layout_submits_2026-09-12.md🤖 Generated with Claude Code
https://claude.ai/code/session_01TVraTPgGDVypESTsVqXPgi