Skip to content

fix(packtest): a template's dummy enters with no score on its name - #1235

Merged
stellarfeline merged 3 commits into
mainfrom
fix/packtest-fresh-body
Oct 27, 2026
Merged

stellarfeline merged 3 commits into
mainfrom
fix/packtest-fresh-body

Conversation

@stellarfeline

Copy link
Copy Markdown
Owner

A PackTest template's dummy enters with no score on its name

PackTest names dummies from a small pool, and a score belongs to a name, not a body, so a new dummy inherits whatever an earlier dummy of the same name left. Seen in CI on a feature branch: an inherited dw.deaths 1 over dw.death_ack 0 sent the warden-watch dummy down the respawn-wait path (tagged dw_cutscene, spectator), and the warden had nobody to face. The same template shape is on main.

  • New post-pass compiler::freshbody, after compiler::solo: every # @dummy template starts with scoreboard players reset @s. Binding line and validation/packtest-fresh.json (gallery: 252 of 252).
  • Red→green: with dw.deaths 1 / dw.death_ack 0 planted in the warden template beside a second dummy's template, the template without the reset fails at the warden's facing assertion; with it, it passes. Whole gallery PackTest 253/253.
  • Direction: can only turn a proof red.

The wave-compass intermittent on main is not explained by this: its scores sit on a fake-player name, rewritten before each assertion.

🤖 Generated with Claude Code

stellarfeline and others added 3 commits October 27, 2026 01:06
CI red on c2e0e16, tier 2, gallery PackTest:
`gallery:watch_npc_warden failed on line 62! Expected #wr_1 dw.sys to match
1, but got 0`. It is a red the suite could always throw; the merge did not
make it.

Cause. A score belongs to a player's name. PackTest names dummies from a
pool, and the CI log shows the warden template's dummy, `Dummy623`, had been
"squished too much" two seconds earlier in another template and left before
it came back: its name held `dw.deaths` 1 above `dw.death_ack` 0. The
template's `function gallery:tick` ran `cp_respawn_check` for the new body;
alive, with a second player present (the overlapping
`watch_actor_standard_bearer` batch's dummy), the death edge took the
respawn-wait path (`rw_start`: tagged `dw_cutscene`, spectator), and the
warden's watch (`@p[distance=..8,tag=!dw_cutscene]`) had nobody to face.
Whether it reds depends on which name a dummy draws and on which batch
overlaps it; the test was under-specified, not the engine wrong. The same
template, `cp_respawn_check` and `rw_start` are on 2c71988 and on
187091c; neither the seat nor the gallery's campfire prop is on the path
(the edge reaches `rw_start` before any seat is read, and `setup` holds
`#cp` at -1).

Reproduction (local, the build's own tree cut to the warden template and the
standard-bearer one, so a second dummy is present):
- as built: 3 of 3 passed;
- with the inherited residue planted as the template's first commands
  (`dw.deaths 1`, `dw.death_ack 0`): `failed on line 64! Expected #wr_1
  dw.sys to match 1, but got 0` (62 plus the two planted lines).

Fix, the general form: the hard rule for templates is own dummy, own scores,
own init, and a reused name breaks "own scores" for every template, not only
this one. `compiler::freshbody`, run on the finished tree after `solo` and
`handback`, gives every template whose directives carry `# @dummy`
`scoreboard players reset @s` as its first command, so its dummy enters as a
player who has never joined. Binding: "packtest fresh-body binding: 279 of
279 template(s) carry a dummy and reset every score its name holds before
their first command"; `validation/packtest-fresh.json`.

Evidence: the planted residue against the fixed build (planted above the
reset): 3 of 3 passed. The whole gallery PackTest on the fixed build: all 280
required tests passed. Unit test `freshbody::tests`.

Direction: the red could only turn a proof red, never let something ship.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
`module_list.rs` red on 74e2c87 (remote `cargo test --workspace
--no-fail-fast`: 5047 passed, 2 failed, both here): the compiler module doc
list did not name the new module. One line, in declaration order.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@stellarfeline
stellarfeline merged commit 7d4a1a8 into main Oct 27, 2026
23 checks passed
@stellarfeline
stellarfeline deleted the fix/packtest-fresh-body branch October 27, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant