瀏覽代碼

M6.1: fewer scroll pauses when paths change; record manual confirmation

A cell that changed while the hidden buffer was being rebuilt restarted
the whole rebuild (up to 8 frames). Now the rest of the rebuild draws
every cell and the changed cells are redrawn once it is ready. Tour with
the path test build: 272 stall frames instead of 472-752 (allowed 606).
MT6.1 confirmed by the user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main
Daniel Covington 2 天之前
父節點
當前提交
065be27166
共有 4 個文件被更改,包括 18 次插入 和 23 次删除
  1. +1
    -1
      docs/milestones.md
  2. +2
    -1
      docs/verification-status.md
  3. +1
    -1
      project.json
  4. +14
    -20
      src/paths.inc

+ 1
- 1
docs/milestones.md 查看文件

@@ -78,7 +78,7 @@ Requirements: R7, R1, R2, R3, R5
| Task | Description | Requirements | Buildable outcome | Completion check |
|---|---|---|---|---|
| M5.1 | Remove road generation: the world has land, grass and trees, stone and water only; tools/check-world.ps1 fails on any road or bridge tile. | R1 | Worlds without roads | `pwsh -File tools/check-world.ps1 -Runs 10`; manual test MT5.1 |
| M5.2 | Worn paths: a walk count per cell (4,000 bytes), +1 when a person steps into a cell, -1 for every cell every 60 seconds (10 cells every 9 frames); at 128 a land, grass or tree cell becomes a path tile (dark brown patch, one per terrain so it can turn back), below 64 it turns back. Changed cells are redrawn in each buffer while it is hidden (people's dots and saved bytes kept), so the shown map never tears; a buffer in the middle of a rebuild restarts it in full. A test build (PATH_TEST: path at 4, back below 2, one count less every 400 frames) makes it checkable. | R7, R2, R3, R5 | Busy cells turn into paths, unused paths fade | `pwsh -File tools/check-paths.ps1`, `tools/check-scroll.ps1 -Long`, `tools/check-scroll.ps1 -Long -PathTest`; manual test MT5.2 |
| M5.2 | Worn paths: a walk count per cell (4,000 bytes), +1 when a person steps into a cell, -1 for every cell every 60 seconds (10 cells every 9 frames); at 128 a land, grass or tree cell becomes a path tile (dark brown patch, one per terrain so it can turn back), below 64 it turns back. Changed cells are redrawn in each buffer while it is hidden (people's dots and saved bytes kept), so the shown map never tears; a buffer in the middle of a rebuild draws the rest of it in full and redraws the changed cells once it is ready (before M6.1: restarted the rebuild). A test build (PATH_TEST: path at 4, back below 2, one count less every 400 frames) makes it checkable. | R7, R2, R3, R5 | Busy cells turn into paths, unused paths fade | `pwsh -File tools/check-paths.ps1`, `tools/check-scroll.ps1 -Long`, `tools/check-scroll.ps1 -Long -PathTest`; manual test MT5.2 |

Manual verification: see docs/manual-tests.md section M5.



+ 2
- 1
docs/verification-status.md 查看文件

@@ -21,7 +21,7 @@ manual = `pending`, `confirmed by user (<date>)`, `problem reported (<date>): <n
| M4.1 Region generator: each world rolls its own terrain mix; jittered seeds on a grid give every class areas all over the world, shaped by noisy distances, smoothing and removal of thin water; shores from the neighbours; trees on grass. Roads stay a grid of two rows and two columns and become bridges over water. The scroll rebuild skips cells whose tile is already drawn, to keep the 8-frame rebuild with textured terrain everywhere. | passed (2026-12-03, `pwsh -File tools/build.ps1` (4,647 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1 -Runs 10`: 10 of 10 worlds, every 40x20 view with 3+ terrain kinds, map ready 7.1-7.3 s after power-on (generation 4.0-4.1 s), mix spread land 14 / grass-trees 8 / water 13 / stone 16 percentage points; `pwsh -File tools/check-people.ps1`: 1,919 frames, 0 missed, update done by line 20; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`: 734 splits, digits right after 183 of 183 updates; `pwsh -File tools/check-scroll.ps1 -Long`: 4 of 4, tour 22,966 frames with 21 stops byte-exact, 116 stall frames in 15,216 moving frames; fix for walking on bridge water, 2026-12-03: `pwsh -File tools/build.ps1` (4,683 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1` and `-Runs 10`: 10 of 10; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1`: 3 of 3; `pwsh -File tools/check-people.ps1 -Cycles 300000000`: 17,119 frames, 1,408 person-frames on bridges, no dot on a blue or grey pixel; the same check fails on the old code (person 9 on a blue pixel of bridge tile 20); fix for the scroll that did not start, 2026-12-03: `pwsh -File tools/build.ps1`; `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1`: 4 of 4, new restart scenario 12 stall frames over four starts from a cell edge (the same scenario fails on the old code: 1,166 frames held left without moving); `pwsh -File tools/check-people.ps1`: 1,899 frames, 816 person-frames on bridges, pass; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,967 frames with 21 stops byte-exact, 111 stall frames in 15,216 moving frames) | confirmed by user (2026-12-03), after two fixes: people walked on the blue water pixels of bridges, and the scroll sometimes did not start from rest on a cell edge |
| M5.1 Remove road generation: the world has land, grass and trees, stone and water only; tools/check-world.ps1 fails on any road or bridge tile. | passed (2026-12-03, `pwsh -File tools/build.ps1` (4,581 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1` and `-Runs 10`: 10 of 10 worlds, no road or bridge cells; `pwsh -File tools/check-people.ps1`; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1`: 4 of 4) | confirmed by user (2026-12-03) |
| M5.2 Worn paths: walk count per cell, path at 128, back below 64, one count less every 60 seconds. | passed (2026-12-03, `pwsh -File tools/build.ps1` (5,257 bytes); `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-people.ps1`: 1,910 frames; `pwsh -File tools/check-keys.ps1`: 8 of 8; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-paths.ps1` (test build): 27 paths appeared, 4 faded, both buffers match the current world plus dots; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,967 frames, 21 stops byte-exact, 95 stall frames, 6 paths appeared in the normal build during the tour; `pwsh -File tools/check-scroll.ps1 -Long -PathTest`: 5 of 5, tour 70 paths appeared and 38 faded while scrolling, no store into the shown buffer while displayed, 472 stall frames in 15,216 moving frames) | confirmed by user (2026-12-03) |
| M6.1 People's attributes: six 3d6 scores per person, P steps through the people, status line 4 shows the scores, the chosen person's dot blinks. | passed (2026-12-03, `pwsh -File tools/build.ps1` (5,464 bytes); `pwsh -File tools/smoke.ps1` incl. status row 23 "P01 STR"; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-keys.ps1`: 9 of 9, new 'P held' scenario steps to person 2 exactly once, all 96 scores 3-18, status line 4 matches the shown person in every scenario; `pwsh -File tools/check-people.ps1` (expected dots leave out draw_skip); `pwsh -File tools/check-split.ps1`: 727 splits, people-in-view digits right after 182 of 182 updates, all five status rows lit; `pwsh -File tools/check-paths.ps1`: 42 appeared, 11 faded; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,968 frames, 21 stops byte-exact, 100 stall frames. `tools/check-scroll.ps1 -Long -PathTest` passed 5 of 5 on the build before the status fix below (tour 79 paths appeared, 45 faded); its rerun on the final build was still running at commit time) | pending |
| M6.1 People's attributes: six 3d6 scores per person, P steps through the people, status line 4 shows the scores, the chosen person's dot blinks. | passed (2026-12-03, `pwsh -File tools/build.ps1` (5,464 bytes); `pwsh -File tools/smoke.ps1` incl. status row 23 "P01 STR"; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-keys.ps1`: 9 of 9, new 'P held' scenario steps to person 2 exactly once, all 96 scores 3-18, status line 4 matches the shown person in every scenario; `pwsh -File tools/check-people.ps1` (expected dots leave out draw_skip); `pwsh -File tools/check-split.ps1`: 727 splits, people-in-view digits right after 182 of 182 updates, all five status rows lit; `pwsh -File tools/check-paths.ps1`: 42 appeared, 11 faded; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,968 frames, 21 stops byte-exact, 100 stall frames. `tools/check-scroll.ps1 -Long -PathTest` passed 5 of 5 on the build before the status fix below (tour 79 paths appeared, 45 faded); its rerun on the committed build failed only on stall frames (752, allowed 606; screens byte-exact). Fix for that, 2026-12-03: `pwsh -File tools/check-paths.ps1`; `pwsh -File tools/check-scroll.ps1 -Long -PathTest`: 5 of 5, tour 272 stall frames, 66 paths appeared and 34 faded, 21 stops byte-exact; `pwsh -File tools/smoke.ps1`; `pwsh -File tools/check-world.ps1`; `pwsh -File tools/check-people.ps1`; `pwsh -File tools/check-keys.ps1`: 9 of 9; `pwsh -File tools/check-split.ps1`; `pwsh -File tools/check-scroll.ps1 -Long`: 5 of 5, tour 22,964 frames, 99 stall frames, 21 stops byte-exact) | confirmed by user (2026-12-03) |

## Notes

@@ -29,6 +29,7 @@ manual = `pending`, `confirmed by user (<date>)`, `problem reported (<date>): <n
- src/people.inc: people_attr (16 x 6 bytes) rolled 3d6 with rejection sampling (0-5 from 3 random bits) at the end of place_people; shown_person, shown_dirty; draw_skip (the person left out of a draw for 16 of every 32 frames) sits right after move_frame so the checks can save it with the people tables. src/keys.inc reads P (column 5, row 1; new press only). src/status.inc show_person writes status line 4; the main loop calls it only when the person changed, on a frame without the status update (frame time is tight while rebuilding).
- The variables no longer fitted below $4000 (about 290 bytes were free), so the 4,000 walk counts moved to $C000-$CF9F (reset_paths clears exactly 4,000 bytes, so the check phase byte at $CFF0 is untouched); the variables now end at $3013.
- Found by check-split: show_person was first placed between update_status and show_number, which update_status falls into, so the people-in-view number stayed 00 and the scores were rewritten every 4th frame. Fixed before commit.
- Scroll pauses with paths (found by `check-scroll.ps1 -Long -PathTest` after the M6.1 commit: 752 stall frames, allowed 606): a cell that changed while the hidden buffer was being rebuilt restarted the whole rebuild (up to 8 frames). Now the rest of that rebuild draws every cell (rb_diff off, also for the row in progress) and the changed cells stay queued for that buffer, so they are redrawn once it is ready. Cells drawn before the change were compared against the world as it was then, so only the changed cell itself can be stale, and its queued redraw mends it. Tour stall frames 272 instead of 472-752.
- Checks: check-keys gains the 'P held' scenario and checks scores and status line 4 in every scenario; check-people and check-scroll leave out the draw_skip person; check-split expects all five status rows lit; every check now holds P up as well; smoke expects "P01 STR" in row 23.

- 2026-12-03 (M5.2 worn paths):


+ 1
- 1
project.json 查看文件

@@ -682,7 +682,7 @@
},
{
"id": "M5.2",
"text": "Worn paths: a walk count per cell (4,000 bytes), +1 when a person steps into a cell, -1 for every cell every 60 seconds (10 cells every 9 frames); at 128 a land, grass or tree cell becomes a path tile (dark brown patch, one per terrain so it can turn back), below 64 it turns back. Changed cells are redrawn in each buffer while it is hidden (people's dots and saved bytes kept), so the shown map never tears; a buffer in the middle of a rebuild restarts it in full. A test build (PATH_TEST: path at 4, back below 2, one count less every 400 frames) makes it checkable.",
"text": "Worn paths: a walk count per cell (4,000 bytes), +1 when a person steps into a cell, -1 for every cell every 60 seconds (10 cells every 9 frames); at 128 a land, grass or tree cell becomes a path tile (dark brown patch, one per terrain so it can turn back), below 64 it turns back. Changed cells are redrawn in each buffer while it is hidden (people's dots and saved bytes kept), so the shown map never tears; a buffer in the middle of a rebuild draws the rest of it in full and redraws the changed cells once it is ready (before M6.1: restarted the rebuild). A test build (PATH_TEST: path at 4, back below 2, one count less every 400 frames) makes it checkable.",
"requirements": [
"R7",
"R2",


+ 14
- 20
src/paths.inc 查看文件

@@ -12,8 +12,9 @@
; buffers have it. The redraw keeps the people's dots in the cell (a dot is the
; only %11 pixel) and updates the saved bytes under them, so restoring a dot
; later puts back the new tile. If the hidden buffer is in the middle of a
; rebuild, the rebuild starts again and draws every cell (its skip test
; compares world tiles, which have changed underneath it).
; rebuild, the rest of the rebuild draws every cell (its skip test compares
; world tiles, which have changed underneath it) and the changed cells are
; redrawn when it is ready.
;
; The test build (PATH_TEST, tools/run.ps1 -PathTest) uses small thresholds
; and fast decay so paths can be watched and checked within a minute.
@@ -199,28 +200,21 @@ apply_changes:
sta ap_bit
lda buf_ready,x
bne @ready
lda #0 ; being rebuilt: if a cell is new to it, restart
sta ap_index ; the rebuild, drawing every cell (only then:
ldy chg_count ; restarting every frame would never finish it)
ldy chg_count ; being rebuilt: is a queued cell new to it?
@mark: dey
bmi @marked
bmi @drop ; no: the rebuild already allowed for them all
lda chg_done,y
and ap_bit
bne @mark
lda chg_done,y
ora ap_bit
sta chg_done,y
inc ap_index
bne @mark
@marked:
lda ap_index
beq @drop
lda buf_cx,x
sta rb_tx
lda buf_cy,x
sta rb_ty
jsr start_rebuild ; buf_ready = 0: no skipping, no saved bytes
jmp @drop
cpx rb_buf
bne @drop
lda #0 ; yes: the rest of the rebuild draws every cell,
sta rb_diff ; also in the row it is on (its skip test
lda #<no_old_tiles ; compares world tiles, and one changed under
sta rb_old+1 ; it). The cells stay queued for this buffer and
lda #>no_old_tiles ; are redrawn once it is ready, which mends a
sta rb_old+2 ; changed cell the rebuild had already drawn.
jmp @drop ; (Restarting the rebuild cost up to 8 frames.)
@ready: ldy #0
@entry: cpy chg_count
beq @drop


Loading…
取消
儲存

Powered by TurnKey Linux.