first commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# Final review package: Ref1 surface reflection
|
||||
|
||||
The workspace is not a Git repository. Use the preserved shader baseline and the exact file list below as the complete change set.
|
||||
|
||||
## Requirements
|
||||
|
||||
Read: `D:/project/behind_glass/.superpowers/sdd/surface-reflection/task-1-brief.md`.
|
||||
|
||||
## Changed product and regression files
|
||||
|
||||
- Pre-edit shader: `D:/project/behind_glass/docs/qa-surface-reflection/baseline-mosaic.frag`
|
||||
- Final shader: `D:/project/behind_glass/src/shaders/mosaic.frag`
|
||||
- New regression: `D:/project/behind_glass/scripts/test-surface-reflection.mjs`
|
||||
|
||||
The production shader differs from the baseline only in the final non-atlas reflection statement. Its SHA-256 is `5FB0AE93482AF46833B076EABFB0018E8BFEBA0A83BFD244DCD210371E450180`.
|
||||
|
||||
## Reports and review history
|
||||
|
||||
- Implementer/TDD report: `D:/project/behind_glass/docs/qa-surface-reflection/implementation-report.md`
|
||||
- Controller browser QA: `D:/project/behind_glass/docs/qa-surface-reflection/visual-verification.md`
|
||||
- Task review packages/results are summarized in `D:/project/behind_glass/.superpowers/sdd/surface-reflection/progress.md`.
|
||||
|
||||
Task review required two test-only fix rounds. The final scoped review approved complete amplitude/output binding, constant-white mutation rejection, unchanged refraction expressions, complete effective atlas-source comparison, and earlier atlas-reflection mutation rejection. Production shader did not change during either fix.
|
||||
|
||||
## Verification evidence
|
||||
|
||||
- Focused command: `node scripts/test-surface-reflection.mjs`
|
||||
- Focused output: `surface reflection source/math regression passed; constant-output and atlas-reflection mutations rejected`
|
||||
- The implementation report records six existing scripts passing and `npm.cmd run build` exit 0 immediately after the production shader change.
|
||||
- Controller browser QA observed no new runtime errors; only the pre-existing `X3595` warning remained.
|
||||
- Gloss 0 pane crop was pixel-identical before/after. Default final reflection widened the changed crop coverage from 12.80% to 15.81% relative to gloss 0; the final-vs-baseline mean absolute change was 0.3106/255 and concentrated around the shared top-right light.
|
||||
|
||||
## Known limits
|
||||
|
||||
- No GPU screenshot of the intermediate broad-reflection-only stage was captured.
|
||||
- Default-strength visual change is subtle; `after-glass-only.png` isolates it, while `before-default.png` and `after-default.png` are the primary same-condition result.
|
||||
- Real-device mobile performance, continuous-video flicker, touch, and gyro were not measured.
|
||||
- Existing Vite large-chunk advisory and shader `X3595` warning remain.
|
||||
@@ -0,0 +1,22 @@
|
||||
# SDD ledger — plan: .superpowers/sdd/surface-reflection/task-1-brief.md
|
||||
|
||||
| Check | Produces / consumes | Result |
|
||||
| --- | --- | --- |
|
||||
| Task 1 internal consistency | Test invariants drive the requested shader-only behavior | Clean: the requested broad reflection and separated reflection edge weight are independently testable. |
|
||||
| Task 1 file interfaces | `mosaic.frag` consumes existing camera, light, gloss, pane and normal uniforms; no new pass is required | Clean: current plan requires no interface change outside the shader. |
|
||||
| Task 1 preservation constraints | New final-pass reflection must not enter atlas/palette/history or change refraction sampling | Clean: explicit write scope and invariants cover the boundary. |
|
||||
|
||||
Environment: `D:\project\behind_glass` is not a Git repository, so native/manual worktree setup and SHA-based review packages are unavailable. Work proceeds in place with an exact pre-edit shader snapshot and file-based review package.
|
||||
|
||||
Task 1 implementer: `01a0c9b1-382a-79e1-9f89-93e834836c4a` (Luna). Status: DONE_WITH_CONCERNS; automated verification reported green, GPU/browser visual comparison delegated to controller.
|
||||
|
||||
Task 1: fix round 1/5 dispatched for two Important regression-test findings; production shader unchanged.
|
||||
|
||||
Task 1: fix round 1/5 result (1 addressed, 1 open — complete atlas-path exclusion not covered; production shader unchanged).
|
||||
Task 1: fix round 2/5 dispatched for the remaining complete atlas-path exclusion finding; production shader unchanged.
|
||||
|
||||
Task 1: fix round 2/5 result (1 addressed, 0 open — complete effective atlas path compared with baseline; production shader unchanged).
|
||||
Task 1: complete (file-based review clean; no Git commits because this workspace is not a repository).
|
||||
|
||||
Final whole-change Astra review: clean; no Critical, Important, or Minor findings. Ready to retain in the non-Git workspace.
|
||||
Ruling: retain this plan's `.superpowers/sdd/surface-reflection` workspace — no Git history exists to preserve the task brief, fix-round record, or review packages elsewhere — cost if wrong: hidden workspace clutter remains in the project.
|
||||
@@ -0,0 +1,52 @@
|
||||
# Task 1: Ref1 surface reflection
|
||||
|
||||
Source plan: final work instruction in Codex task `01a0c768-534f-7660-9d86-c5ae50f71b1f`.
|
||||
|
||||
## Goal
|
||||
|
||||
Keep Ref1 option 2's large rectangular color planes and dark eye/nose readability while making the whole glass pane, including grass, read as glass.
|
||||
|
||||
## Required implementation
|
||||
|
||||
- Preserve the existing rectangular light reflection in `src/shaders/mosaic.frag`.
|
||||
- Add a broad, soft, low-strength reflection component derived from the existing curved normal and current view direction. Reuse the current light/intersection model where possible; do not add an environment texture, render pass, render target, UI, or dependency.
|
||||
- Composite both reflections after color-plane simplification and before output color-space conversion. Do not put reflection into `REGION_ATLAS`, palette selection, or history.
|
||||
- Control both reflections with the existing `uGlossStrength`. At gloss 0 the new reflection contribution must be exactly zero.
|
||||
- Keep the same signed curved normal for refraction and reflection. Reflection must respond to view direction, be stable when still, and vary spatially rather than applying a uniform white mix.
|
||||
- Keep the refraction `edgeWeight` and all existing world-delta/sample-boundary behavior unchanged. Add a separate surface-reflection edge weight, starting from `mix(0.35, 1.0, edgeWeight)`, and tune only if visual comparison shows a bright rim. Both existing and new reflection use the surface-reflection weight.
|
||||
- Keep the pane bounds so reflection does not spill onto the wooden reveal/frame or outside the glass.
|
||||
|
||||
## Must remain unchanged
|
||||
|
||||
- Grid 13, curvature +1, gloss 0.30, region/distortion 1, camera 0.50 defaults and option ranges.
|
||||
- Ref1 option 2 palette fitting, dark rectangular color-plane preservation, 70 ms history, view-dependent refraction, photo/depth placement, manual framing, and inner window reveal.
|
||||
- No original eye/nose pixel restoration, global blur, stronger black grid, per-cell random brightness, time animation, grass/pet masks, automatic framing, or changes to Reeded/Frosted.
|
||||
|
||||
## TDD and automated verification
|
||||
|
||||
Before production shader edits, add one minimal source/math regression script that fails for the missing behavior and then passes. It must check only this change's invariants:
|
||||
|
||||
- gloss 0 removes both existing and broad reflection;
|
||||
- surface reflection weight stays in range and does not replace the refraction edge weight;
|
||||
- broad reflection is spatial/view dependent rather than a constant white mix;
|
||||
- reflection composition remains outside `REGION_ATLAS` and before color-space conversion.
|
||||
|
||||
Record the exact RED and GREEN commands/output. Label source/math assertions honestly; they are not GPU visual verification. Run the existing six scripts and `npm.cmd run build` after implementation.
|
||||
|
||||
## Baseline and visual QA
|
||||
|
||||
- Preserve the exact pre-edit `src/shaders/mosaic.frag` under `docs/qa-surface-reflection/baseline-mosaic.frag` before editing.
|
||||
- Use dog1 with completed AI depth and fixed values: Final/Mosaic, Grid 13, curvature +1, gloss 0.30, region/distortion 1, light X/Y 0.60/0.80, depth scale 0.25, camera offset 0.50, photo zoom/pan 1/0/0.
|
||||
- Capture same-viewport images for baseline, broad reflection only, and final edge separation when practical. Also inspect gloss 0/0.30/0.40, curvature -1/0/+1, camera 0.90, a portrait viewport, and one indoor image.
|
||||
- Passing visual result: grass shows distinct curved surface reflection rather than uniform brightening; adjacent cells respond coherently; pane edges retain material without a bright rim or leakage; eyes/nose remain dark and face/grass do not wash out.
|
||||
- Gloss 0 must remain visually equivalent to the baseline. Distortion 0 and other glass modes must retain existing behavior.
|
||||
|
||||
## Write scope
|
||||
|
||||
- Required: `src/shaders/mosaic.frag`, one narrowly scoped script under `scripts/`, `docs/qa-surface-reflection/` baseline/QA/report files.
|
||||
- `src/main.ts` may be edited only if inspection proves the existing uniforms cannot support the required shader behavior; explain first in the report.
|
||||
- Do not touch palette/history shaders, UI, camera, photo/depth placement, or window reveal.
|
||||
|
||||
## Report contract
|
||||
|
||||
Write `docs/qa-surface-reflection/implementation-report.md` with changed files, final coefficients and rationale, RED/GREEN evidence, full verification results, visual comparison paths, and remaining limitations. Do not claim GPU or mobile behavior that was not observed.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Task 1 fix round 1 review package
|
||||
|
||||
Review only the two Important findings from the first Astra review.
|
||||
|
||||
## Files
|
||||
|
||||
- Current regression (changed): `D:/project/behind_glass/scripts/test-surface-reflection.mjs`
|
||||
- Updated report (changed): `D:/project/behind_glass/docs/qa-surface-reflection/implementation-report.md`
|
||||
- Production shader (unchanged during fix): `D:/project/behind_glass/src/shaders/mosaic.frag`
|
||||
- Preserved baseline: `D:/project/behind_glass/docs/qa-surface-reflection/baseline-mosaic.frag`
|
||||
- Original task brief: `D:/project/behind_glass/.superpowers/sdd/surface-reflection/task-1-brief.md`
|
||||
|
||||
## Fix evidence
|
||||
|
||||
- Production shader SHA-256 remains `5FB0AE93482AF46833B076EABFB0018E8BFEBA0A83BFD244DCD210371E450180`.
|
||||
- Current test SHA-256: `B924F91C82D0805C23C292BE613B21B6253E73C17C45F78D54E0AFAF6BC94A54`.
|
||||
- Command: `node scripts/test-surface-reflection.mjs`
|
||||
- Output: `surface reflection source/math regression passed; constant-output mutation rejected`
|
||||
|
||||
The test now extracts complete individual statements, evaluates the actual `specGloss`, `broadReflection`, and final mix expression for representative inputs, compares refraction expressions to the preserved baseline, inspects the effective atlas branch, and asserts that a constant 50% white-output mutation is rejected.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Task 1 fix round 2 review package
|
||||
|
||||
Review only the remaining atlas-exclusion finding from fix round 1.
|
||||
|
||||
## Files
|
||||
|
||||
- Current regression: `D:/project/behind_glass/scripts/test-surface-reflection.mjs`
|
||||
- Updated report: `D:/project/behind_glass/docs/qa-surface-reflection/implementation-report.md`
|
||||
- Unchanged production shader: `D:/project/behind_glass/src/shaders/mosaic.frag`
|
||||
- Preserved baseline: `D:/project/behind_glass/docs/qa-surface-reflection/baseline-mosaic.frag`
|
||||
|
||||
## Evidence
|
||||
|
||||
- Production shader SHA-256 unchanged: `5FB0AE93482AF46833B076EABFB0018E8BFEBA0A83BFD244DCD210371E450180`.
|
||||
- Current test SHA-256: `E4430C19827D0253C5E3EF073D702170C9552E3CAD09997D00D1C0405A66ED8A`.
|
||||
- Command: `node scripts/test-surface-reflection.mjs`
|
||||
- Output: `surface reflection source/math regression passed; constant-output and atlas-reflection mutations rejected`
|
||||
|
||||
The test now compares the complete source segments executed while `REGION_ATLAS` is defined against the preserved baseline and applies a mutation that inserts gloss-dependent white mixing in an earlier atlas section. That mutation must be rejected.
|
||||
@@ -0,0 +1,45 @@
|
||||
# Task 1 review package
|
||||
|
||||
This workspace is not a Git repository. Review the exact files below as the file-based equivalent of a task diff.
|
||||
|
||||
## Required inputs
|
||||
|
||||
- Task brief: `D:/project/behind_glass/.superpowers/sdd/surface-reflection/task-1-brief.md`
|
||||
- Implementer report: `D:/project/behind_glass/docs/qa-surface-reflection/implementation-report.md`
|
||||
- Pre-edit shader: `D:/project/behind_glass/docs/qa-surface-reflection/baseline-mosaic.frag`
|
||||
- Current shader: `D:/project/behind_glass/src/shaders/mosaic.frag`
|
||||
- New regression: `D:/project/behind_glass/scripts/test-surface-reflection.mjs`
|
||||
|
||||
## Shader diff (`git diff --no-index --unified=10`)
|
||||
|
||||
```diff
|
||||
@@ -258,17 +258,17 @@ void main(){
|
||||
vec2 historyTexel=clamp(floor(fract(gridUv)*8.),vec2(0.),vec2(7.));
|
||||
vec2 historyUv=(cell*8.+historyTexel+.5)/uRegionAtlasSize;
|
||||
vec4 splitHistory=texture2D(uRegionHistory,historyUv);
|
||||
vec3 splitColor=splitHistory.a>.00001?splitHistory.rgb/splitHistory.a:radialColor;
|
||||
vec3 candidateColor=mix(radialColor,splitColor,splitHistory.a);
|
||||
color.rgb=mix(color.rgb,candidateColor,clamp(uRegionStrength*clamp(uStrength,0.,1.)*regionSurfaceValid(finalSceneUv,gh),0.,1.));
|
||||
}
|
||||
#endif
|
||||
#ifndef REGION_ATLAS
|
||||
color.a=1.;
|
||||
- vec3 v=normalize(uContentCameraPosition-gh),reflected=reflect(-v,nCurved); float lightT=(uLightPosition.z-gh.z)/safeZ(reflected.z); vec2 lightHit=gh.xy+reflected.xy*lightT; vec2 halfSize=vec2(.32,.42)*min(uPaneSize.x,uPaneSize.y); vec2 windowCoord=abs(lightHit-uLightPosition.xy)/halfSize; vec2 windowMask=1.-smoothstep(vec2(.45),vec2(1.15),windowCoord); float spec=windowMask.x*windowMask.y*step(.0001,reflected.z)*step(0.,lightT); float gloss=spec*clamp(uGlossStrength,0.,1.)*.12*edgeWeight*clamp(uStrength,0.,1.); color.rgb=mix(color.rgb,vec3(1.),gloss); gl_FragColor=color;
|
||||
+ vec3 v=normalize(uContentCameraPosition-gh),reflected=reflect(-v,nCurved); float lightT=(uLightPosition.z-gh.z)/safeZ(reflected.z); vec2 lightHit=gh.xy+reflected.xy*lightT; vec2 halfSize=vec2(.32,.42)*min(uPaneSize.x,uPaneSize.y); vec2 windowCoord=abs(lightHit-uLightPosition.xy)/halfSize; vec2 windowMask=1.-smoothstep(vec2(.45),vec2(1.15),windowCoord); float surfaceReflectionWeight=mix(.35,1.,edgeWeight); float glossStrength=clamp(uGlossStrength,0.,1.); float spec=windowMask.x*windowMask.y*step(.0001,reflected.z)*step(0.,lightT); float specGloss=spec*glossStrength*.12*surfaceReflectionWeight*clamp(uStrength,0.,1.); vec2 broadWindowMask=1.-smoothstep(vec2(.15),vec2(1.75),windowCoord); float broadFacing=pow(max(dot(nCurved,v),0.),2.); float broadReflection=broadWindowMask.x*broadWindowMask.y*broadFacing*glossStrength*.035*surfaceReflectionWeight*clamp(uStrength,0.,1.); color.rgb=mix(color.rgb,vec3(1.),specGloss+broadReflection); gl_FragColor=color;
|
||||
#include <colorspace_fragment>
|
||||
#else
|
||||
color.a=atlasEvidence;
|
||||
gl_FragColor=color;
|
||||
#endif
|
||||
}
|
||||
```
|
||||
|
||||
The test and report are new files and must be read in full. The exact shader baseline hash reported by the implementer is `CEE5F75C7A62A9146CBE451C661C2E0066EE57EB8963A7B0F56C281873F37E35`.
|
||||
|
||||
## Controller visual evidence so far
|
||||
|
||||
- `docs/qa-surface-reflection/before-default.png`
|
||||
- `docs/qa-surface-reflection/after-default.png`
|
||||
- Same 1280×720 dog1/AI-depth/default-condition capture.
|
||||
- Frame-interior pixel comparison: mean absolute channel difference `0.3106/255`, max channel difference `14`, changed channels `13.85%`.
|
||||
- This confirms a change but does not establish that the requested glass-surface improvement is visually sufficient.
|
||||
Reference in New Issue
Block a user