-
Notifications
You must be signed in to change notification settings - Fork 14
Fix starship render regressions and document autonomous PTY debugging #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
926fd75
refactor(renderer): replace WeakMap theme propagation with stack
RtlZeroMemory da8fd8c
chore(native): sync Zireael v1.3.8-alpha.8
RtlZeroMemory 494413e
core(drawlist): add buildInto for v2 and v3 builders
RtlZeroMemory 183532e
ci: optimize PR pipeline — concurrency, fast gate, reduced matrix
RtlZeroMemory f91ab87
Revert "ci: optimize PR pipeline — concurrency, fast gate, reduced ma…
RtlZeroMemory a19b132
EPIC 6: packed style pipeline + Zireael vendor bump
RtlZeroMemory f35b754
Merge remote-tracking branch 'origin/main' into perf/ink-compat-optim…
RtlZeroMemory 25f82d5
fix(core): restore canvas overlay hex parsing
RtlZeroMemory a559378
fix(ci): satisfy guardrails, lint, and typecheck
RtlZeroMemory 8f0978b
fix(review): address outstanding PR threads and CI regressions
RtlZeroMemory c9ed046
feat: land blit-rect pipeline and regression audit tooling
RtlZeroMemory 47375c9
Fix refactor regressions and sync native vendor to Zireael PR
RtlZeroMemory cd9c387
Bump vendored Zireael to include review-thread fixes
RtlZeroMemory 29d53d1
vendor zireael: bump to c0849ae after main merge
RtlZeroMemory 3155af7
Address PR #223 unresolved review feedback
RtlZeroMemory 5882c57
Merge remote-tracking branch 'origin/main' into perf/ink-compat-optim…
RtlZeroMemory 4cbcb8b
Fix drawlist text perf counters and CI lockfile sync
RtlZeroMemory 85c87d9
Fix regression dashboard lint violations
RtlZeroMemory 45836e7
Fix CI lint failures and apply review nitpicks
RtlZeroMemory ef53eef
Apply biome formatting fixes for CI lint
RtlZeroMemory 697af04
Fix starship template theme to use packed rgb colors
RtlZeroMemory d55b8a4
Fix starship rendering regressions and add PTY debug runbook
RtlZeroMemory File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| # Live PTY UI Testing and Frame Audit Runbook | ||
|
|
||
| This runbook documents how to validate Rezi UI behavior autonomously in a real | ||
| terminal (PTY), capture end-to-end frame telemetry, and pinpoint regressions | ||
| across core/node/native layers. | ||
|
|
||
| Use this before asking a human for screenshots. | ||
|
|
||
| ## Why this exists | ||
|
|
||
| Headless/unit tests catch many issues, but rendering regressions often involve: | ||
|
|
||
| - terminal dimensions and capability negotiation | ||
| - worker transport boundaries (core -> node worker -> native) | ||
| - partial redraw/damage behavior across many frames | ||
|
|
||
| The PTY + frame-audit workflow gives deterministic evidence for all of those. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| From repo root: | ||
|
|
||
| ```bash | ||
| cd /home/k3nig/Rezi | ||
| npx tsc -b packages/core packages/node packages/create-rezi | ||
| ``` | ||
|
|
||
| ## Canonical interactive run (Starship template) | ||
|
|
||
| This enables: | ||
|
|
||
| - app-level debug snapshots (`REZI_STARSHIP_DEBUG`) | ||
| - cross-layer frame audit (`REZI_FRAME_AUDIT`) | ||
| - worker execution path (`REZI_STARSHIP_EXECUTION_MODE=worker`) | ||
|
|
||
| ```bash | ||
| cd /home/k3nig/Rezi | ||
| : > /tmp/rezi-frame-audit.ndjson | ||
| : > /tmp/starship.log | ||
|
|
||
| env -u NO_COLOR \ | ||
| REZI_STARSHIP_EXECUTION_MODE=worker \ | ||
| REZI_STARSHIP_DEBUG=1 \ | ||
| REZI_STARSHIP_DEBUG_LOG=/tmp/starship.log \ | ||
| REZI_FRAME_AUDIT=1 \ | ||
| REZI_FRAME_AUDIT_LOG=/tmp/rezi-frame-audit.ndjson \ | ||
| npx tsx packages/create-rezi/templates/starship/src/main.ts | ||
| ``` | ||
|
|
||
| Key controls in template: | ||
|
|
||
| - `1..6`: route switch (bridge/engineering/crew/comms/cargo/settings) | ||
| - `t`: cycle theme | ||
| - `q`: quit | ||
|
|
||
| ## Deterministic viewport (important) | ||
|
|
||
| Many regressions are viewport-threshold dependent. Always test with a known | ||
| size before comparing runs. | ||
|
|
||
| For an interactive shell/PTY: | ||
|
|
||
| ```bash | ||
| stty rows 68 cols 300 | ||
| ``` | ||
|
|
||
| Then launch the app in that same PTY. | ||
|
|
||
| ## Autonomous PTY execution (agent workflow) | ||
|
|
||
| When your agent runtime supports PTY stdin/stdout control: | ||
|
|
||
| 1. Start app in PTY mode (with env above). | ||
| 2. Send key sequences (`2`, `3`, `t`, `q`) through stdin. | ||
| 3. Wait between keys to allow frames to settle. | ||
| 4. Quit and analyze logs. | ||
|
|
||
| Do not rely only on static test snapshots for visual regressions. | ||
|
|
||
| ## Frame audit analysis | ||
|
|
||
| Use the built-in analyzer: | ||
|
|
||
| ```bash | ||
| node scripts/frame-audit-report.mjs /tmp/rezi-frame-audit.ndjson --latest-pid | ||
| ``` | ||
|
|
||
| What to look for: | ||
|
|
||
| - `backend_submitted`, `worker_payload`, `worker_accepted`, `worker_completed` | ||
| should stay aligned in worker mode. | ||
| - `hash_mismatch_backend_vs_worker` should be `0`. | ||
| - `top_opcodes` should reflect expected widget workload. | ||
| - `route_summary` should show submissions for every exercised route. | ||
| - `native_summary_records`/`native_header_records` confirm native debug pull | ||
| from worker path. | ||
|
|
||
| If a log contains multiple app runs, always use `--latest-pid` (or `--pid=<n>`) | ||
| to avoid mixed-session confusion. | ||
|
|
||
| ## Useful grep patterns | ||
|
|
||
| ```bash | ||
| rg "runtime.command|runtime.fatal|shell.layout|engineering.layout|engineering.render|crew.render" /tmp/starship.log | ||
| rg "\"stage\":\"table.layout\"|\"stage\":\"drawlist.built\"|\"stage\":\"frame.submitted\"|\"stage\":\"frame.completed\"" /tmp/rezi-frame-audit.ndjson | ||
| ``` | ||
|
|
||
| ## Optional deep capture (drawlist bytes) | ||
|
|
||
| Capture raw drawlist payload snapshots for diffing: | ||
|
|
||
| ```bash | ||
| env \ | ||
| REZI_FRAME_AUDIT=1 \ | ||
| REZI_FRAME_AUDIT_DUMP_DIR=/tmp/rezi-drawlist-dumps \ | ||
| REZI_FRAME_AUDIT_DUMP_MAX=20 \ | ||
| REZI_FRAME_AUDIT_DUMP_ROUTE=crew \ | ||
| npx tsx packages/create-rezi/templates/starship/src/main.ts | ||
| ``` | ||
|
|
||
| This writes paired `.bin` + `.json` files with hashes and metadata. | ||
|
|
||
| ## Native trace through frame-audit | ||
|
|
||
| Native debug records are enabled by frame audit in worker mode. Controls: | ||
|
|
||
| - `REZI_FRAME_AUDIT_NATIVE=1|0` (default on when frame audit is enabled) | ||
| - `REZI_FRAME_AUDIT_NATIVE_RING=<bytes>` (ring size override) | ||
|
|
||
| Look for stages such as: | ||
|
|
||
| - `native.debug.header` | ||
| - `native.drawlist.summary` | ||
| - `native.frame.*` | ||
| - `native.perf.*` | ||
|
|
||
| ## Triage playbook for common regressions | ||
|
|
||
| ### 1) “Theme only updates animated region” | ||
|
|
||
| Check: | ||
|
|
||
| 1. `runtime.command` contains `cycle-theme`. | ||
| 2. `drawlist.built` hashes change after theme switch. | ||
| 3. `frame.submitted`/`frame.completed` continue for that route. | ||
|
|
||
| If hashes do not change, bug is likely in view/theme resolution. | ||
| If hashes change but screen does not, investigate native diff/damage path. | ||
|
|
||
| ### 2) “Table looks empty or only one row visible” | ||
|
|
||
| Check `table.layout` record: | ||
|
|
||
| - `bodyH` | ||
| - `visibleRows` | ||
| - `startIndex` / `endIndex` | ||
| - table rect height | ||
|
|
||
| If `bodyH` is too small, inspect parent layout/flex and sibling widgets | ||
| (pagination or controls often steal height). | ||
|
|
||
| ### 3) “Worker mode renders differently from inline” | ||
|
|
||
| Run both modes with identical viewport and compare audit summaries: | ||
|
|
||
| - worker: `REZI_STARSHIP_EXECUTION_MODE=worker` | ||
| - inline: `REZI_STARSHIP_EXECUTION_MODE=inline` | ||
|
|
||
| If only worker diverges, focus on backend transport and worker audit stages. | ||
|
|
||
| ## Guardrails | ||
|
|
||
| - Keep all instrumentation opt-in via env vars. | ||
| - Never print continuous debug spam to stdout during normal app usage. | ||
| - Write logs to files (`/tmp/...`) and inspect post-run. | ||
| - Prefer deterministic viewport + scripted route/theme steps when verifying fixes. | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace hardcoded local path with portable repo-root instructions.
Line 24 and Line 37 use
/home/k3nig/Rezi, which won’t work for most contributors.🛠️ Proposed doc fix
Apply this at both occurrences.
Also applies to: 37-38
🤖 Prompt for AI Agents