Repository navigation
glass: the test bed has a shadow scene that proves one shadow on GPU pixels - #1148
Merged
Merged
Conversation
…pixels Signed-off-by: fizzy pop-os-claude-1 <slot+pop-os-claude-1@fizzy.invalid>
|
TRIAGE @76bc41f3 auto: mechanical rules met (fizzy-* app author, names work#1006, 166 non-test lines <= 400, no risky path). Labelled |
Contributor
Where this PR standsStage: Author's turn What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):
Reviews at the current commit (
2 earlier reviews are for older commits and will be redone. Updated 2026-11-06 18:48 UTC by the PM. This comment is edited in place. |
Signed-off-by: fizzy pop-os-claude-1 <slot+pop-os-claude-1@fizzy.invalid>
Contributor
Author
|
Rework published. |
Signed-off-by: fizzy foxnne-desktop-claude-2 <slot+foxnne-desktop-claude-2@fizzy.invalid>
Contributor
|
Rework published. |
This branch was successfully 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.
glass: the test bed measures the shadow joined glass casts
In plain words
When two pieces of glass run together in fizzy, they should cast one soft shadow, the way one piece would. The glass test bed now has a second scene that draws the same outline as one piece and as two joined pieces, on the real graphics path, and measures how much darker the joined version is. A shadow that doubles up, or a ring left inside the glass, shows up as a number instead of something a person has to spot.
What changes
pair(the drop meeting the bar, unchanged) or the newshadow.shadowscene has two pictures: a small drop sitting inside the bar, and two boxes overlapping by 40 pt. Each is compared with the single piece of glass that has the same outline.What you will notice
Nothing visible: internal. It lets a change to the glass shadow be checked on rendered pixels, with a number to hold it to, rather than by eye.
How we know it works
New unit tests check that both scene names are read and an empty output path is refused, the step count for each scene, that the hole in the measured area is skipped, and that each measured area has pixels in it. For the overlap they also check that no corner of the area is covered by the joined glass. The rendered measurement itself (
scripts/glass-testbed.sh shadow) could not be run in the worker's sandbox, which blocks starting the app under a virtual display. Its rows are still to be pasted here (see below).How this serves fizzy
It holds the glass's shadow to a measured number, so it stays right as the glass changes: Fast, and measured applied to materials and polish.
For agents: technical summary
Goal
SH1 (#1137) proves "one shadow" on the CPU mirror (
LiquidField.sampleWith). This proves it on GPU pixels, throughcore.dialogs.glassBubbleswith.merge = 12, .shadow = 1.What changed and why
src/editor/GlassTestbed.zig:Confighasscene: Scene(pair,shadow).parsereads<scene>:<dir>.stepsis nowsteps(scene)(pair 26, shadow 2). The pair scene's pictures, options and rows are as before. Thebarfield becameregion(plushole).shadowPictures(case, window, fade, offset)gives A, B and the region in points:inside: A is the 340×64 bar (r 24). B is the bar plus a 40×40 drop (r 20) centred in it. Region: the drop outset bysurfaceShadow().fade, intersected with the bar, with the drop as a hole.overlap: A is one 160×60 box (r 20). B is two 100×60 boxes (r 20) at x 0 and x 60, same top. Region: x 60…100, from the bottom edge down byfade + offset.y.ghostMaxtakes an optionalholeand skips pixels inside it, outset byghost_inset(2 px, the same as the rect's inset). Pair passesnull, so its numbers don't change.{"scene":"shadow","case":"inside"|"overlap","dark_max":D,"x":..,"y":..}, with D =ghostMax(B, A, region, hole), how much darker B is than A.scripts/glass-testbed.shacceptsshadow. It prints the row with the largestghost_max(pair) ordark_max(shadow).How it was verified
scripts/zb build,scripts/zb build test(217/217 steps,fizzy-glass-testbed-tests5/5),scripts/zb build test-integration(110/110 steps),scripts/zb build lint,scripts/zb build check-web: all pass.zig fmt --checkis clean on both Zig files. The sandbox refused to runscripts/check-fmt.sh. The slot reruns it.fizzy-glass-testbed-tests, whichbuild/app.zigputs inzig build test, nottest-integration. They pass there. Foroverlap,sampleWith(...).coverage == 0at the four corners of the measured area (the region inset byghost_inset) with B's field at scale 1 and merge 12.scripts/glass-testbed.sh shadowand a directxvfb-runof the built binary. So these are still to be pasted:dark_max≤ 2/255 (≈ 0.0078).insideregion (the ring round the drop, inside the bar). That would raise the"case":"inside"row on main without SH1 being at fault. Whether linux: work-525 #946 has merged was not checked: the worker may not call GitHub.Not done / follow-ups
🤖 Generated with Claude Code
Part of fizzyedit/work#1006