Repository navigation
Modern home residents leave for the day and come home as people - #2342
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The docs preview for this pull request was removed when it closed. |
📸 Screenshot drift checkNo drift: the committed screenshots already match a fresh deterministic generation. ✅ |
/gds-code-review, round 1 (author's lean pass), commit d3d8ffaThis is the author's pass: Blind Hunter, Edge Case Hunter and the Hot-Path Auditor, run in one lean pass. An independent review from a separate thread is still needed before this leaves draft. Triage: 0 patch, 0 defer, 2 dismissed, 1 owner decision pending.
Generated by Claude Code |
d3d8ffa to
7834419
Compare
maniator
left a comment
There was a problem hiding this comment.
Independent review (stand-in for Copilot, with /gds-code-review run in one lean pass), commit 7834419
Copilot, Codex and PR-Agent are down, so this is the independent review. I ran Blind Hunter, Edge Case Hunter, Acceptance Auditor and Hot-Path Auditor over the full diff from b3eab2e, plus the 7834419 follow-up, which changes only test goldens. I also built main and this branch and measured both with callgrind.
Verdict: NO-GO on 7834419. The design is sound, and the commute logic, save adoption and tests hold up. The blockers are a Classic slowdown that is easy to fix, a red required check and the screenshot refresh.
Must fix (patch)
- Classic gets slower for no gain (inline on
dispatch_waiting.rs:39). Every Classic tower pays +1.2 to 1.3% tick instructions, with an identical crowd. Hoisting the mode test out of the loop brings that to about +0.2%. I measured it locally and pushed nothing. - A required check is red.
test-engine (host, shard 1 of 3)fails insrc/tests/perfCompare/scenarios.integration.test.ts:61: split-tower.vctower's one-day crowd peak is now 16, and the test expects 23. Update the pin, and updatedocs/performance/ts-vs-wasm.md:82("peaks at 23 people"), as the test's comment asks. - 4 committed screenshots drift (drift-check comment). The body says "Screenshots: None, no UI change". Render the refresh in the pinned container, push it, and fix that section.
- The record disagrees with itself. The body's Complexity section says split-tower-4 release step time is "+4 to 8%". The round-1 comment says "no measurable difference". Please replace both with the instruction counts below. HP-4 and HP-5 are marked "n/a", but the hourly
sort_shiftsnow sorts the homes' bookings too, anddesksnow holds homes. Both are within the hourly and edit tiers' budgets, but the rows should say what was checked. - Stale comment.
MAX_SAVED_DESKSincrowd/commuters_save.rs:33still says "one per office". Desks now cover offices, venues and homes. The cap is still far above any real tower.
Owner decision: is the Modern slowdown real?
Yes, but it is small. Callgrind counts on tick over 4 game days, main to this branch:
| Tower | Instructions | Crowd mean | Crowd peak |
|---|---|---|---|
| split-tower-4 | +1.81% (+1.56% with the per-kind cache) | 637 → 659 | 2,593 → 2,669 |
| split-tower-26 | +0.39% | 528 → 545 | 2,591 → 2,740 |
| sixseven_2, towerone_6 (Classic) | +1.2 to 1.3% (+0.2% with patch 1) | unchanged | unchanged |
What remains in Modern after patch 1 is the cost of about 3% more people actually riding. Wall-clock timing can't settle it here: best-of-3 release runs of the same binary varied by up to 15%. The instruction count is the honest figure. Drawn-rider waits on split-tower-4 also rise, from 57 to 71 s (the author's figure). Whether that fits "nothing slower" is Naftali's call.
Optional (low)
- A home sold or let during weekday office hours shows 0 occupants until 4 PM, because
home_duenever books the one who stays home by day. Under the clock it read 1 from the next hour. - Modern loses the sampled school run. The help pages say so. Mention it to the owner, since it was one of Modern's "livelier" features.
Dismissed after checking
- Pre-change saves.
adopt_head_countstakes a home's savedoccupantsas the residents at home, so nobody appears or vanishes on load. - Census and star population.
census_countreadsresident_count, notoccupants, so they are unchanged. - Classic canon. 17 of the 29 conformance scenarios moved, and all of them are Modern.
- Shift save cap.
MAX_SAVED_WALK_INS(20,000) leaves room for a rush hour's home bookings. - Tests. The
home_commute.rstests run a real engine and can fail; nothing replays recorded answers.
Hot-path record (section 6), commit 7834419
| Item | Result | What was checked | Findings and resolution |
|---|---|---|---|
| HP-1 | clear | accumulate (per step, from dispatch_pass). book/home_due (hourly, from book_commutes, and on edits from start_commutes). square/stranded (on edits and hourly). update_presence (hourly). adopt_head_counts/restore_desks (on load). spawn_trips/push_routine_options (spawn step). unit_detail/wasm_port_panels (on demand). |
none |
| HP-2 | finding (1) | accumulate: a per-room predicate on every step, outside the kind cache, costing +1.2 to 1.3% in Classic |
F1 patch (inline) |
| HP-3 | clear | No allocation added outside #[cfg(test)] |
none |
| HP-4 | clear | sort_shifts (hourly) now sorts the homes' bookings too, a few hundred per hour on split towers. O(S log S) at the hourly tier. |
none |
| HP-5 | clear | The desks BTreeMap grows to include homes. Lookups are hourly and per edit, with no per-step access. |
none |
| HP-6 | clear | Homes are looked up by id (get_unit/marked_by_id), and no removal was added |
none |
| HP-7 | clear | Commute machinery inherited from #2238, reviewed as new where homes enter it (due, stranded, sync_head_count, at_destination) |
none |
| HP-8 | finding (1) | The last kind cache in accumulate is bypassed by the new arrives_in_person call |
F1 (same fix) |
| HP-9 | clear | F1's remedy: hoist the mode test (measured +0.2% in Classic), or fold rides into the cache (measured +1.56% on split-tower-4) |
F1 |
| HP-10 | clear | Classic conformance unchanged. The Modern lock, frame-day and fuzz goldens re-recorded. Reload mid-rush tested. | Ask for an equivalence check on F1's fix |
| HP-11 | clear | workersComing reuses coming_to, one number per panel read |
none |
| HP-12 | clear | No renderer code change. Screenshot drift comes from the crowd, not the drawing code (patch 3). | none |
Reviewed against Verticopolis conventions (.github/copilot-instructions.md).
Generated by Claude Code
7834419 to
cfb6a76
Compare
Round 2 fixes, commit cfb6a76 (rebased onto main at cb85b56)These fix the independent review's NO-GO on 7834419:
Local runs: Generated by Claude Code |
cfb6a76 to
ba74233
Compare
maniator
left a comment
There was a problem hiding this comment.
Independent re-review, round 2: ba74233 (the same PR diff as cfb6a76, rebased onto main at 2b991a4)
I compared the PR's own diff at cfb6a76 against ba74233. It is identical, and main changed no engine code in between, so this verdict and the measurements cover both commits. I ran stand-in-pr-review plus the BMGD/BMAD lenses (Blind Hunter, Edge Case Hunter, Acceptance Auditor, Hot-Path Auditor) on the round-2 interdiff, and I re-measured with callgrind.
Verdict: NO-GO on ba74233. One item is left: the Classic slowdown fix made Classic slower, not faster (inline on dispatch_waiting.rs:40). It went from +1.2% to +1.6% on both Classic towers, which have identical crowds. The fix is the small change in the inline comment.
Round 1 findings
- Classic slowdown: not fixed, and worse. See the inline comment.
- perfCompare pin: fixed. It is 16, and
ts-vs-wasm.md:82matches. - Screenshots: fixed. Four shots were re-rendered in the pinned image and committed separately, and the body says so.
- Speed record: fixed in the body. Once patch 1 lands, it needs the new Classic numbers, since "about +0.2%" is not what this commit measures.
MAX_SAVED_DESKScomment: fixed.
New in round 2: the move-in fix in home_due
It looks correct. short = stays - inside - coming books the stay-at-home resident only while the home is below its daytime count. The morning departures leave inside == stays, so it never fights them. A studio has stays == 0, so the fix never applies there. The arrival enters through the lobby or the Metro, so nobody warps. The new test fails without the fix, since it asserts exactly one lobby-to-home trip before 3 PM.
Modern cost (owner decision, not blocking)
split-tower-4 is now +1.99% and split-tower-26 +0.64%. Crowd means went from 637 to 659 and from 528 to 545. With the loop shape fixed, these should drop by about 0.2 to 0.4 points. What remains is the cost of the riders being real.
Hot-path record (section 6), commit ba74233
| Item | Result | What was checked | Findings and resolution |
|---|---|---|---|
| HP-1 | clear | accumulate (per step, dispatch_pass). home_due (hourly from book, and on edits from start_commutes). commuters_restore/MAX_SAVED_DESKS (load). The rest is unchanged since round 1's record. |
none |
| HP-2 | finding (1) | accumulate: the kind cache is now consulted for every room ahead of the occupancy exit, at +1.6% in Classic |
F1 patch (inline) |
| HP-3 | clear | No allocation added. The short arm is O(1). |
none |
| HP-4 | clear | As in round 1. The short arm adds at most one booking per home per hour. |
none |
| HP-5 | clear | As in round 1 | none |
| HP-6 | clear | As in round 1 | none |
| HP-7 | clear | home_due's new arm reviewed as new |
none |
| HP-8 | clear | The kind cache is kept. The fix keeps main's waits cache and adds a rides cache only behind some_ride. |
none |
| HP-9 | finding (1) | F1 remedy: main's loop shape plus a guarded census check, measured +0.19 to +0.38% in Classic | F1 |
| HP-10 | clear | The author's referee check (0 of 29 diverge) covers the restructure. The move-in fix moves only the Modern lock, which was re-recorded with compat-record.json, and the frame-day golden held. |
none |
| HP-11 | clear | No boundary change in round 2 | none |
| HP-12 | clear | Screenshots refreshed from the pinned image. No renderer change. | none |
CI at ba74233 was still running when I checked. Before merge, rebase onto main again if it has moved.
Reviewed against Verticopolis conventions (.github/copilot-instructions.md).
Generated by Claude Code
ba74233 to
60e887d
Compare
|
Round 3 (head 60e887d), answering the round-2 NO-GO on
The branch is still two commits (code, screenshots), rebased on main 2b991a4. Re-review requested. Generated by Claude Code |
maniator
left a comment
There was a problem hiding this comment.
Independent re-review, round 3: 60e887d
Since ba74233, the only change is the ElevatorDispatch::accumulate loop. It is now main's loop shape: the waits kind cache after the occupancy exit, and the census check guarded by some_ride && u.kind.arrives_in_person(..). That matches the suggested fix and computes the same values (the author reports 0 of 29 referee scenarios diverge). The rest of the PR diff is unchanged from round 2, which I reviewed, and the base is current main (2b991a4).
Verdict: GO on 60e887d, once required CI is green. It was still running when I checked, with no failures so far.
Measurements (callgrind on tick, 4 game days of one-minute steps from fixture load, against main)
| Tower | This commit | Crowd mean |
|---|---|---|
| sixseven_2 (Classic) | +0.21% | unchanged |
| towerone_6 (Classic) | +0.23% | unchanged |
| split-tower-4 (Modern) | +2.05% | 637 → 659 |
| split-tower-26 (Modern) | +0.65% | 528 → 545 |
- Classic is at parity, within the inlining noise I saw between builds of equivalent code. The author's −0.28% and −0.13% fit that same noise band.
- Modern: the owner accepted +1.40% on split-tower-4. My harness measures +2.05% for the same commit. The difference is probably the window (4 days from load against the author's run), so the accepted figure may understate the cost by about half a point. I'm flagging it so the decision rests on both numbers. It does not block this GO, since the owner has ruled on the Modern cost.
Hot-path record (section 6), commit 60e887d
| Item | Result | What was checked | Findings and resolution |
|---|---|---|---|
| HP-1 | clear | accumulate (per step, dispatch_pass). Every other function is unchanged since round 2's record (home_due, book, square, update_presence, adopt_head_counts, the panels). |
none |
| HP-2 | clear | accumulate: Classic asks no per-room predicate (some_ride is false). Modern asks one per present room, inside the walk main already makes. Measured +0.2% in Classic. |
F1 from rounds 1 and 2 fixed |
| HP-3 | clear | No allocation added | none |
| HP-4 | clear | sort_shifts hourly, with homes' bookings added (as in round 2) |
none |
| HP-5 | clear | desks holds homes, read only hourly and on edits |
none |
| HP-6 | clear | Lookups by id only | none |
| HP-7 | clear | Inherited commute machinery and the new home_due arms reviewed as new in rounds 1 and 2 |
none |
| HP-8 | clear | Main's per-kind waits cache is kept as it was. No cache dropped. |
none |
| HP-9 | clear | F1's remedy applied as named | none |
| HP-10 | clear | The restructure is value-equivalent (0 of 29 diverge, and the Classic crowd is identical in my runs). The Modern lock and goldens were re-recorded in round 2. | none |
| HP-11 | clear | No boundary change | none |
| HP-12 | clear | Screenshots from the pinned image (round 2). No renderer change. | none |
Reviewed against Verticopolis conventions (.github/copilot-instructions.md).
Generated by Claude Code
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
60e887d to
0f9b52e
Compare
Condo, apartment and studio residents in Modern now commute through the crowd's desks (Workplace::Home): on weekdays all but the one who stays in leave through the ground lobby or the Metro over 7 to 10 AM and come home over 4 to 7 PM, and everyone is home at night and on weekends. Their homes stop feeding the dispatch's invisible waiting estimate and the lobby share leaves out the in-person population, so elevator cars no longer run for riders nobody can see. Classic homes keep the clock's head count. The sampled school run is off where residents commute themselves. The Modern conformance cases, the frame-day golden and the Modern fuzz-corpus golden move; the help pages say how residents come and go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trZ598PcWMS1jHGVohe
Rendered in the pinned Playwright container (v1.61.1-jammy, full Chromium): the three Metro line shots and the security search show a different Modern crowd now that residents commute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7trZ598PcWMS1jHGVohe
0f9b52e to
64df027
Compare
What & why
Naftali saw elevator cars on his split tower move with nobody drawn aboard. The cause was the dispatch's invisible waiting estimate: condos, apartments, studios and hotel rooms, plus a share of the whole population at every lobby, raised hall calls, and cars drove there and carried numbers that are never drawn. He chose to make those riders real people instead of hiding the cars (design note #2135 option A, step 7 "homes, then hotels"). This is the homes half; hotel guests follow in a second PR.
In Modern, condo, apartment and studio residents now commute through the crowd's desks (
crowd::commuters, newWorkplace::Home). On weekdays all but the one who stays in (nobody, in a studio) leave through the ground lobby or the Metro over 7 to 10 AM and come home over 4 to 7 PM. At night and on weekends everyone is home. A home'soccupantsis the residents at home, the hourly presence pass skips these homes, and they no longer feedaccumulate_waiting; the lobby share leaves out the in-person population, so nobody is counted twice. Classic homes keep the clock's head count.The sampled school run is off where residents commute themselves (its child took residents out of the home and could leave the head count off by one).
Measured over 4 game days, main against this branch, on split-tower-26, split-tower-4, sixseven_2 and towerone_6: every tenant kept; moving car-minutes with no drawn rider fell from 54% to 46% and 46% to 40% on the two split towers; Classic identical; about 500 more people a day ride.
Type of change
Game mode impact
The switch is
GameMode::residents_commute_in_person(rules/commute.rs), read throughKind::lives_in_personandKind::arrives_in_person. The Classic conformance cases do not move.Quality gates
npm run typecheck(CI)npm run lint(CI)npm test(CI)npm run build(CI)Local:
cargo test(all pass),npm run test:wasm:host(all pass),cargo clippy --all-targets -D warnings,cargo fmt --check, the conformance referee,conformanceWasm*(276 pass after the re-record) andscripts/fuzz-corpus.ts(13 entries agree).Versioning
.changesnote with the rightapp:andcrate:levels, or this PR changes no deployed pathpackages/verticopolis-engine/README.mdand/orengine-rs/CRATE_README.md, or read both and putreadmes: unchangedin the note, or this PR changes no engine sourceThe lock moved (Modern cases only), so
crate: minorandcompat-record.jsonis refreshed. The frame-day golden and the Modern five-star fuzz golden move with it.Complexity
Hot paths and call frequency (tier), sizes, complexity before and after, remaining scans and why, caches kept or replaced (HP-8), invalidation evidence, measurements:
ElevatorDispatch::accumulate(per step): one more counter in the existing walk of the units, guarded by a mode test hoisted out of the loop; O(units) before and after, no new scan, and main's loop shape (empty rooms leave before any per-kind work).Workplace::due/home_due(hourly booking, per desk): O(1) per home, the same walk the offices and venues already take.update_presence(hourly): homes that arrive in person are skipped, so it does less.sort_shifts(hourly) now also sorts the homes' bookings, a few hundred an hour on the split towers: O(S log S) at the hourly tier. ThedesksBTreeMap now holds homes too, with lookups only hourly and on edits.accumulatekeeps main's loop shape and the in-person census check runs only whenoffice_workers_commute_in_personholds, which is false for a whole Classic tower. Earlier rounds measured split-tower-26 at +0.39%. Wall-clock timings can't separate the builds here: best-of-3 release runs of one binary vary by up to 15%. The Modern cost is the price of the extra riders being real, and the owner accepted it (2026-11-16).lastcache inaccumulatenow folds whether the kind's people ride in person into its cached answer (HP-8). The desks and shifts already saved for offices and venues carry homes too, and nothing was dropped.Hot-path record (section 6): pending, posted by the review skill on this PR.
Screenshots / recordings
There is no UI change. Four gallery shots (
metro-line-east,metro-line-middle,metro-line-west,security-search-joins) show a different crowd, because residents now come and go. They were re-rendered in the pinned Playwright container and committed. The help pages (Homes, People and traffic, Classic vs Modern) say how residents come and go, and the existing "N on the way" occupants text covers homes.Notes for reviewers
rule_tests/home_commute.rs(weekday out and back, a per-minute ledger that nobody appears or vanishes on a home floor, weekends, Classic, a lost tenant, the estimate, a reload mid-rush). Estimate-based tests that used Modern condos moved to Classic.a_home_let_by_day_has_its_stay_at_home_resident_come_in).🤖 Generated with Claude Code
https://claude.ai/code/session_01Ms7trZ598PcWMS1jHGVohe