This document outlines the standard test pages and scenarios used in the automated visual regression suite (npm run capture-golden).
The suite targets a set of local HTML files representing common web UI archetypes. These are located in tests/reference-pages/.
| Page | Archetype | Key Features to Observe |
|---|---|---|
| dashboard.html | SaaS / App UI | "Google Search" style list. Sidebar + Main content. Good for testing Lateral Smash on list items. |
| article.html | Reading Layout | Long-form centered text. Standard blog/news reading experience. |
| ecommerce.html | Retail Grid | Image heavy, grid layout. Product cards. Verifies image preservation + text distortion. |
| grid.html | Geometric Calibration | Pure grid of circles/lines. Used for verifying geometric warp linearity and overlay alignment. |
For each page, the suite captures screenshots with the fovea positioned at three critical points to verify different eccentricities.
- Coordinates:
0.5, 0.5(Mid-screen) - Purpose: Standard viewing. Verifies foveal clarity in the middle of content and peripheral degradation at edges.
- Coordinates:
0.2, 0.2(Reading start) - Purpose: Simulates reading or navigating headers. Verifies that the bottom-right periphery distorts correctly without breaking the layout.
- Coordinates:
0.15, 0.5(Navigation focus) - Purpose: Mimics looking at a sidebar menu. Verifies that the main content area (now in periphery) is degraded but structurally present.
- Description: Raw Saliency Texture debug view.
- Purpose: Verify the heatmap integrity (Blue→Green→Red). Critical Regression Check: Ensure it is not solid red.
- Description: Raw Structure Texture debug view.
- Purpose: Verify density clustering and type packing. Critical Regression Check: Ensure individual blocks are visible and not "over-painted".
Run the following command to regenerate all golden images:
npm run capture-goldenArtifacts Location: tests/golden-captures/v1.4.2/
You can force specific debug modes using CLI arguments. This is critical for verifying the underlying feature maps before running a full regression suite.
| Flag | Effect | Pass Criteria (What to look for) | Fail Criteria (Red Flags) |
|---|---|---|---|
--debug-saliency |
Shows Saliency Heatmap | Blue/Green/Red Gradient. Text/Edges should be Red. Background should be Blue. | Solid Red Screen (Data corruption/overflow). Solid Blue (Empty map). |
--debug-saliency |
Shows Saliency Heatmap | Blue/Green/Red Gradient. Text/Edges should be Red. Background should be Blue. | Solid Red Screen (Data corruption/overflow). Solid Blue (Empty map). |
--debug-structure |
Shows Structure Map | Red Overlay. Density determines opacity. Blocks should match page content. | "Shredded" Noise (Byte packing error). Invisible (Alpha channel issue). |
We use two distinct testing patterns depending on the scope of the feature.
When to use: For specific, isolated features (like Face Detection) where a full regression suite is overkill or where custom setup (e.g., specific loading time, specific image content) is required.
- Pattern: Create a standalone Node.js script in
scripts/(e.g.,scripts/verify-face-detection.js) that launches Electron with specific flags and captures a single output. - Pros: Fast iteration, isolated environment.
- Cons: Does not test integration with other pages.
When to use: Before any release or major merge.
- Pattern:
npm run capture-golden - Pros: Tests all reference pages and fixations.
- Cons: Slow (~2-3 mins).
A targeted test exists to verify the "Face Channel" integration. This test loads a page with a known face (text/reference-pages/face-test.html) and captures the saliency map.
node scripts/verify-face-detection.js- The output image (
tests/verification/face_detection_result.png) must show a bright red/white hotspot directly over the face. - The hotspot should be roughly Gaussian (soft circular blob).
# Verify Saliency Map is working
npm start -- --debug-saliency
# Verify Structure Map packing
npm start -- --debug-structureBefore shipping ANY change to structure-map.js or peripheral.frag, you MUST manualy verify:
- Saliency Map Integrity: Run
--debug-saliency. If it looks like a solid color, STOP. You have broken the mapping. - Blueprint Mode Clarity: Run
--blueprint. Images should be solid blocks, not "fuzz". Text should be "schematic lines". - Red Saliency Regression: We have hit this twice. Always check that the saliency map is NOT full-red.
Automated tests that validate saliency features at the pixel level.
node scripts/verify-saliency-pixels.js- Loads
face-test.html, enables saliency debug view - Checks pixel at face location (1686, 777)
- Pass Criteria: R value > 100 (indicates face detected as salient)
- Captures two images: one with
enableSaliencyModulation: false, one withtrue - Compares pixel values at face location
- Pass Criteria: Pixel delta > 5 (proves modulation affects rendering)
✅ Face Saliency Hotspot Verified (Value > 100)
✅ Saliency Modulation Verified (Pixels changed)
✅ ALL PIXEL VERIFICATIONS PASSED