Commit Graph
232 Commits
Author SHA1 Message Date
irisandClaude Opus 5 c5a10ac845 Record #11 as approved
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 18:56:16 -04:00
irisandClaude Opus 5 a009261fae Record the wgpu 30 upgrade and why it is not pushed yet
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 18:42:17 -04:00
irisandClaude Opus 5 64d8042f52 Record the primitive render dispatch and how it was measured
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 18:30:52 -04:00
irisandClaude Opus 5 912602d52b Order the remaining Iris slices by how fundamental they are
The owner asked for library updates and core framework changes first, so code
is only written once, and for tests to arrive with a slice rather than as
scripts outside the repository. So wgpu 28 -> 30 and the headless rig and
harness come before any of the feature slices.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 17:45:34 -04:00
irisandClaude Opus 5 2937a48133 Record the seventh #11 review
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 17:44:21 -04:00
irisandClaude Opus 5 8beb461d83 Record the sixth #11 review
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 17:23:54 -04:00
irisandClaude Opus 5 43f6bda92d Record the fifth #11 review
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 16:53:00 -04:00
irisandClaude Opus 5 8daf1bcac1 Record the fourth #11 review and the agreed texture design
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 16:15:59 -04:00
iris 26f86bc6f7 Rewrite the Iris extraction handoff for a fresh session
Current as of PR #11's fourth review, which is deliberately unread: the
first instruction is to fetch it. Records what #11 became over three
rounds of review, since that shape is what the new review is about, and
where the headless rig actually lives, since a rendering claim cannot be
verified without it.

Drops the finished detail -- PR #10's contents, the source-history
archaeology that has been consumed -- and points at the machine-wide
pre-submit-review gate rather than restating it.
2026-09-13 15:50:09 -04:00
iris bc555f9ded Record the #11 review and the pre-submit gate in the handoff 2026-09-13 12:48:24 -04:00
iris a9d63babe4 Record the two open Iris extraction PRs in the handoff 2026-09-13 04:01:47 -04:00
iris e774b465fd Document Iris extraction handoff 2026-09-13 03:45:02 -04:00
iris 50d214e5b1 Move Iris to its standalone repository 2026-09-12 23:16:47 -04:00
iris 715c86e7e2 iris: eliminate retained-frame heap churn 2026-09-12 22:44:03 -04:00
iris 77b39a97e3 iris: process dirty widgets one at a time 2026-09-12 22:05:06 -04:00
iris b1416d86bf iris: drive animation from painter frame time 2026-09-12 21:37:47 -04:00
iris 9fe6aca1f1 iris: make span compaction explicit 2026-09-12 21:18:09 -04:00
iris adb8276ef4 iris: keep text overflow masks horizontal 2026-09-12 20:59:54 -04:00
iris 93c106e2f8 iris: clip ellipsized text at cluster boundaries 2026-09-12 20:54:26 -04:00
iris 1f0a7b5f94 iris: add positioned text overflow 2026-09-12 19:58:02 -04:00
iris cb5f11d21a iris: separate layout allocation from lengths 2026-09-12 19:35:18 -04:00
iris 90dffce514 iris: add replaceable glyph atlas buckets 2026-09-12 18:10:55 -04:00
iris c97df72015 iris: share resource handle bookkeeping 2026-09-12 17:13:49 -04:00
iris a8093b002b iris: move text state into shared resources 2026-09-12 14:18:12 -04:00
iris 4cbe7baea0 iris: make font families application-named strings 2026-09-12 13:09:31 -04:00
iris bdc9c914c4 iris: load application-owned fonts 2026-09-11 14:14:41 -04:00
iris 779f5c63d3 Organize Iris support files 2026-09-11 13:06:52 -04:00
iris 0ead062379 Rename app_init to android_init 2026-09-11 12:36:50 -04:00
iris ecf74055c7 Simplify Iris app initialization and task updates 2026-09-11 12:28:33 -04:00
iris 8218e84b62 Run Iris examples on desktop and Android 2026-09-11 11:33:04 -04:00
iris df1290904b Add Iris Android APK tooling 2026-09-11 03:44:06 -04:00
iris e137f38a5d Return the tabs demo to one example 2026-09-11 02:18:34 -04:00
iris 213a0debb7 Use one standard Iris resource bundle 2026-09-11 02:09:17 -04:00
iris d8bb1699a8 Make the Rust client the sole app 2026-09-11 01:18:24 -04:00
iris f49b284b46 iris: fold render state into Ui 2026-09-10 23:58:43 -04:00
iris 599d33287c Add scoped overlay hosts 2026-09-10 18:49:03 -04:00
iris de92fccba5 Add retained paints and shared text selection 2026-09-10 18:35:24 -04:00
iris 25370731d0 Prune commentary and stale Rust port notes 2026-09-10 00:44:13 -04:00
iris 5428cd75c9 Prune Iris TODO and prioritize color correctness 2026-09-09 23:35:12 -04:00
iris 8c6e2ed9cf docs: record final phone benchmark comparison 2026-09-09 22:57:50 -04:00
iris 4bc23172fd Make Iris layout dependencies explicit 2026-09-09 22:35:03 -04:00
iris e5fee03da8 Stop composer layout recursion on spaces 2026-09-09 19:54:53 -04:00
iris 5ece49b8d9 Settle growing layout branches in one frame 2026-09-09 16:54:39 -04:00
iris e212ed8d02 Document separate benchmark publication repo 2026-09-09 16:23:38 -04:00
iris fffed42f9e Move LazySpan rows through one retained offset 2026-09-09 16:15:09 -04:00
iris 0aa03cf621 Redesign span layout around retained placement 2026-09-09 15:11:57 -04:00
iris ae0af8f5e3 iris: ScrollArea measures its content instead of drawing it twice
A container that probes a child's size was still doing it with a real
draw, so `Painter::measure` existed and almost nothing used it. Tracing
every draw of one streamed frame: 1,083 `Widget::draw` calls over 113
distinct widgets, the worst drawn 11 times at nesting depth 7-8, every
one of them mode `Draw` and none of them dirty. The cache was working --
each of the 11 was offered a genuinely different region, alternating
between an oversized probe box and a real one.

ScrollArea::draw was one of the two sources. It drew its whole content
at a box built from a stale hint, read the length back, corrected the
scroll position, and drew the content again where it belonged. The first
of those is now a measurement.

The other half is the measure fast path. A widget's reported size is a
function of its own state and the size it was offered, not of where it
was offered -- so an undirtied widget already drawn at a region of this
size has already answered, and `active.size` is the answer. This is the
same assumption `mov` makes one branch further down (same offered size,
therefore identical output, therefore a translation); it is only stated
as a size here rather than acted on as a move. Without it a measurement
costs a full recursive walk, which is what made the nesting compound.

A measurement now also peeks at the redraw mark instead of consuming it
-- it is not the redraw the mark asked for, and swallowing it would
leave the widget stale until something marked it again.

453 draws from 1,083, and the streamed frame is p50 1.18ms (from 1.22ms,
and 2.20ms before this run of work). The headless phone render is
byte-identical to the previous commit's on the real GPU.

What is deliberately NOT here: the same change to `Span::draw`'s phase 1,
which is the remaining 2x and which moves the layout by a few pixels.
The layout stays intact -- it is a position difference, not a broken
frame -- but which of the two is correct was not established, and the
suspicion (that phase 2 now takes `mov`, and `mov` accumulates deltas
where a redraw recomputes) points at a bug in `mov` rather than in
`Span`. Written up in docs/IRIS_TODO.md with Iris's target shape for
`Span`: no probe phase at all for `abs` children, and a `rest` child
forcing a reposition pass rather than a redraw.
2026-09-09 12:08:20 -04:00
iris 18c5f9aaac iris: a measurement is a mode on the painter, not a discarded draw
Painter::draw_twice(child, first, |used| second) becomes Painter::measure
plus an ordinary draw. Iris's objection was the shape it forced on the
caller rather than the two draws themselves: the arithmetic that picks
the real region had to happen inside a closure, and anything it wanted to
keep came back out through a captured &mut. LazySpan::place was the only
caller, and it now reads as the three statements it is.

DrawMode::Measure is that draw with everything it writes switched off --
no arena slot, no mask, no move slot, nothing left in `active`, nothing
marked dirty. Only the returned Size survives, and the widget is left
exactly as it was, so the real draw that follows is an ordinary first
draw or redraw. That last part is load-bearing: a measurement that left
an ActiveData behind would let the following draw hit draw_inner's
"already at this region" fast path and return having drawn nothing.

A measurement also does not consume a redraw mark, since it is not the
redraw the mark asked for, and it takes none of the fast paths, since
"already drawn here" cannot report a size.

Every Painter method that writes now returns early on the mode -- a
widget's own draw never checks, which is the point. A debug_assert at the
end of draw_inner catches one that forgot, because the failure otherwise
is a single leaked primitive per measured widget per frame, which a
screen redrawn every frame turns into an arena that grows without bound.

What this is worth, and what it is not. The amplification it applies to,
measured on a streamed frame: 1,083 Widget::draw calls over 113 distinct
widgets, with the worst drawn 11 times at nesting depth 7-8 -- it is not
two draws but two to the power of how many measuring ancestors a widget
has. Only the writes go away; the walk and the region arithmetic still
happen 11 times, and removing those needs a size answerable without a
draw, which LAYOUT.md section 5 rules out. Streamed frame p50 1.39ms ->
1.22ms, p99 4.75ms -> 3.58ms. The upload numbers do not move, because
slot recycling had already made the discarded writes free in arena terms.

Also extracts move_slot_for from draw_inner, since measuring must not
allocate one and the reuse-in-place rule wanted saying once.

Verified: run-tests.sh, iris's suite, clippy and rustfmt clean, and the
headless phone render is byte-identical to the previous commit's on the
real GPU (Venus, RX 7900 XT -- checked, not llvmpipe).
2026-09-09 11:51:33 -04:00
iris a428cba41a iris: record the streamed-row redraw as an open item
arena_churn says a streamed frame uploads 72.7% of the instance arena
and that this is the floor, against 3.3% for a fling over the same
content -- so the rows are being redrawn where a scroll would write one
move_offsets delta. The upload half landed in 3c7d3db; this is the
layout half, with the measurement, the control that makes it convincing,
and where to look first.
2026-09-09 11:34:30 -04:00
iris 3c7d3db370 iris: the arenas upload deltas, and stop being 11x bigger than the tree
Changing any primitive re-uploaded every primitive. Measured over the
bench fixture by the new arena_churn rig: 758 MB across a fling and
1.2 GB across 401 streamed deltas, p50 3.0 MB per streamed frame.

Three separate things were wrong, and only the first is what it looked
like from the outside.

ArrBuf reallocated on every length change. A fresh Buffer's contents are
undefined, so adding one glyph -- which a streamed reply does constantly
-- forced a full rewrite, and no partial upload could have been correct
in the first place. It has a capacity now, growing geometrically and
never shrinking, and update() answers whether the Buffer identity moved
so a caller can rebuild its bind group and force the whole range dirty.
That alone took the glyph array from 95% re-uploaded to 3%, and stopped
primitive_group being rebuilt on every frame the arena changed.

A redraw freed its primitives and pushed new ones. Freed slots are not
reusable until the end of the frame -- a layer's draw order still names
them -- and Painter::draw_twice is how a container learns a child's
size, so with containers nested the arena's high-water was the transient
push count rather than the live one: 17 million pushes across 401
deltas, 127,443 slots for 11,569 live primitives, growing linearly with
the transcript. A redraw now gets its old handles back as a recycle pool
(Painter::take_recycled, Primitives::recycle) and writes into the slots
it already holds; the pool is consumed in order and whatever the draw
does not claim is freed when it ends. The arena is exactly the live
count now. The CPU frame improved with it, from p50 2.20ms to 1.39ms on
the stream run, because the freeing and the draw-order renumbering went
away.

Nothing tracked which entries changed. util::Dirty is a bitset per
uploaded array, coalesced into ranges at a 1 KiB gap. Marking is O(1)
and allocation-free; reading it back is one word per 64 entries. Both
alternatives were measured and rejected: a min..max span is nearly the
whole buffer, since a frame's changes land in 5-20 scattered runs, and a
Vec of indices would mean an allocation and a sort per frame at several
thousand marks. It replaces Primitives::updated -- one bool that covered
the instances and the per-primitive data together, so rewriting a rect's
region re-uploaded every glyph -- and TrackedArena::changed.

The trap only the rig could catch: writing an entry is not changing it.
Recycling rewrote every glyph of every moved row with identical bytes,
marking 73% of the glyph array against 0.6% genuinely changed, because
what moves is the instance's region and not the glyph. PrimitiveVec::set
and Primitives::set_instance compare before marking.

Every array now uploads within a hair of its floor: fling instances 3.4%
against 3.3%, fling glyphs 0.9% against 0.8%, stream glyphs 0.6% against
0.6%. Stream instances are at 72.7%, which *is* the floor and is a
layout question rather than an upload one -- the list is pinned to the
newest end, so a growing reply moves every row, and that should be one
move_offsets write rather than a redraw. Noted in RUST.md as the next
thing.

Also: draw_inner's four old_* parameters become one Retained struct, so
the recycle pool is a field rather than an eleventh positional argument
next to three others of the same shape; and free_primitive is the one
place a slot and its draw-order position are retired together.

The rigs move to scripts/rigs/ui-profile, a crate of their own so a
rig's dependencies stay out of the app's -- arena_churn needs bytemuck,
which nothing in ai-app does. arena_churn prints floor, uploaded and
whole side by side per array, because any two of those alone are
misleading and the 122x over-marking above was invisible until all three
were on screen together.
2026-09-09 02:14:51 -04:00