Repository navigation
Keep riders aboard when their stop is turned off (#2324) - #2328
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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. |
|
The docs preview for this pull request was removed when it closed. |
b280704 to
cac45d6
Compare
maniator
left a comment
There was a problem hiding this comment.
Independent review of #2328 at b280704 (stand-in-pr-review + /gds-code-review, one lean pass, with Hot-Path Auditor)
Verdict: CONDITIONAL GO. The passenger fix is right and its test is honest. One patch finding on housekeepers, and CI needs a fresh run (the engine rust and rust-coverage jobs were cancelled, so the engine-rs roll-up failed; nothing in the code failed).
What I checked
- Indexing.
floors.truncate(leg + 1)keeps the boarding floor atleg, andon.floors[0]is the new stop, sofloors[leg + 1]becomes that stop.shafts.truncate(leg + 1)keeps the shaft being ridden atleg, andon.shaftsfollows it, soshafts[k]still linksfloors[k]tofloors[k + 1]. When the nearest stop is the trip's last floor, the rider alights withleg == shafts.len()and goes toToDest, as the alight arm expects. - Can the car ever let them off? Yes.
routing::elevator_callsrebuilds the cab calls every step from each rider'sfloors[leg + 1], so the car gets a call to the new stop on the next step. That stop is a current stop, so theRidingarm does not fire again unless the player edits the stops again, and each edit reroutes once. - No loop.
stops_ofandstops_atread the same skip list (Transport::stop_floorsfilters the same whole floorsstops_atrejects), andstops_ofis keyed ontower.revision, so the chosen stop can never be the floor that just stopped being one. When the route fails, the code falls togive_up, which ends the trip as before. - Test honesty.
rule_tests::crowdpasses at the head (15 of 15). With main'scrowd/motion.rsput back,a_rider_whose_floor_stops_being_a_stop_rides_on_to_the_nearest_stopfails, so the test does guard the fix. - Docs and versioning. The help line in
elevators.mdxmatches the behavior. The new functions arepub(super)or private, socrate: patchis correct, andreadmes: unchangedholds. The backlog row is marked done.
Findings
-
patch: a housekeeper's work trip can switch to the passenger network.
ride_to_nearest_stopalways routes on withcrowd.route, the passenger network. Before this PR, a staff rider went tostaff_shift::stuck. Now a housekeeper on a Job, Home or Base trip whose service-elevator stop is turned off goes on by passenger elevators and escalators. That breaks the rule instaff_shift.rsthat work trips keep to the staff network (service elevators and stairs).walk::find_another_wayalready treats staff on their own for this reason.The fix is not to go back to
stuck.stuckputs a rider back atp.floor(fy = p.floor, stateToDest), so a housekeeper jumps from the cab to the floor they boarded on, which breaks the no-warping rule. Route a staff rider the waystaff_shift::routedoes:staff_routefor work trips, and for the In and Out commute, staff first and then passenger. Give up only when neither finds a way. Add a rule test with a housekeeper on a service elevator whose stop is turned off. -
Note (non-blocking): when the new route's first leg is the same shaft (for example, the nearest stop is below the turned-off floor and the way on rides the same shaft up past it), the rider gets off and waits for the same shaft again. This is correct and they don't get stuck, but staying aboard would read better. Optional.
Hot-path record (docs/performance/hot-path-review.md, section 6)
| Item | Result |
|---|---|
| HP-1 Surface | crowd/motion.rs Riding arm, per rider per step: hot |
| HP-2 Common path | Unchanged: the new call sits behind !shaft.stops_at(dest), the same branch as before |
| HP-3 New scans | stops_of (memo hit, one Vec clone) and one crowd.route search, once per affected rider per stop edit |
| HP-4 Repeat cost | None: after the reroute, dest is a stop, so the branch does not fire again on later steps |
| HP-5 Allocation | Two Vec extends on the edge path only |
| HP-6 Callers traced | motion::step only; give_up callers are unchanged |
| HP-7 Tier budget | Within budget: an edit-driven event, not per-frame work |
| HP-8 Caches | None dropped or bypassed; uses the existing stops_of memo and route cache |
| HP-9 Determinism | Tie-breaks are total: distance, then nearness to the car (total_cmp), then the lower floor |
| HP-10 Save impact | None: no new fields |
| HP-11 Measured | Not needed: the common path is unchanged (see HP-2) |
| HP-12 Outcome | Pass |
To reach GO
- Fix finding 1 and add its test.
- Rerun CI to green.
- Fold in the stuck-forever soak the author thread is running on both maxed towers.
Reviewed against Verticopolis conventions (.github/copilot-instructions.md).
Generated by Claude Code
📸 Screenshot drift checkNo drift: the committed screenshots already match a fresh deterministic generation. ✅ |
Independent stuck-forever check (asked for by the owner), head c9789dbScope: can this change leave anyone stuck forever, vanishing, or riding with no end? This is not the full review; the "Review triage fix PRs" thread has that. The probes are scratch files, never committed. Method. 5-day soaks of both maxed towers on main (faafa48) and on this head. A seeded stream turns one elevator stop off every 10 minutes, and each comes back 30 minutes later (about 600 toggles per run, rush hours included). Four toggle seeds per tower. Each minute, the probe records:
Verdict: GO on the stuck-forever question. Nobody vanishes from a cab any more, nobody rides on with no stop to get off at, and long waits are the same as main within seed noise. My earlier note about 4+ hour waits rising was not caused by this PR. On the earlier head, the PR run happened to draw a bomb search (a Security tower freezes everyone but the guards), and the main run did not. The car I traced, at floor 32.24 with a rider for 1, was frozen by that search. Code read of
Pre-existing, on main too, not from this PR: on both maxed towers, housekeepers wait 4 to 8 hours for a service elevator. They wait at the lobby (In) and at floor 20 (Home), with Generated by Claude Code |
maniator
left a comment
There was a problem hiding this comment.
Independent re-review of #2328 at c9789db: GO
The earlier patch finding is fixed. The redesign holds, and CI is green on this head (37 passed, 8 skipped).
What changed and what I checked
- Ride on, then reroute on foot.
ride_to_nearest_stopno longer routes inside the cab. It rewrites the trip to[.., boarding, stop, to]on the same shaft. When the rider gets off atstop,stepped_off_shortsees the next leg on that same shaft going to a floor it no longer stops at, and hands the rider tofind_way_on. Whenstop == to, the rider gets off and goes toToDestas usual.stepped_off_shortonly fires for the same shaft to a non-stop floor, a leg no router produces, so ordinary trips are unaffected. - Housekeepers (my finding 1): fixed.
find_way_onroutes staff throughstaff_shift::way_on: the staff network, and the passenger network only for the In and Out commute, the same choicespawn_commuterandsend_outmake. A housekeeper with no way on goes togive_up, thenstuck, which setsfy = p.floor. That is the stop they just stepped off at, so there is no jump out of the cab. - Nobody with no way on vanishes. A non-staff rider leaves through the ground lobby by
route_out_nearest, or by a plain route to floor 1, withreturningset, so the trip ends at the lobby door. Only someone who cannot even reach the lobby falls togive_up. - Test honesty.
rule_tests::crowdpasses at this head (16 of 16). With the first head'smotion.rs,walk.rsandstaff_shift.rsput back, two tests fail:a_housekeeper_whose_floor_stops_being_a_stop_stays_on_the_staff_networkanda_rider_whose_floor_stops_being_a_stop_with_no_way_on_leaves_by_the_lobby. I already showed the original test fails on main. - Soak. The stuck-forever soak by the other thread is on the PR: cab vanishes drop to 0, and 4-hour waits match main.
- Sizes and notes.
walk.rsis 228 lines andmotion.rsis 488, both under 500. The change note and help line describe the lobby exit and the housekeeper rule.crate: patchholds, since the new items arepub(super)andstaff_shift::way_onsits inside a private module.
Hot-path record (section 6)
| Item | Result |
|---|---|
| HP-1 Surface | crowd/motion.rs, the arrive branches of Riding and Climbing: hot (per alight) |
| HP-2 Common path | Adds stepped_off_short per alight: one Vec::get, an id compare and, only on a same-shaft leg, stops_at (bounds plus a skip-list contains). O(1) in practice, no allocation |
| HP-3 New scans | stops_of (memo hit) and the rewrite in ride_to_nearest_stop, once per affected rider per stop edit. find_way_on runs one route search, or two for In/Out staff and for the lobby fallback, once per rider who steps off short |
| HP-4 Repeat cost | None: after the rewrite the next floor is a stop, and after find_way_on the rider holds a fresh route |
| HP-5 Allocation | Two small pushes on the edge path only |
| HP-6 Callers traced | motion::step only. give_up, turn_back and is_still_setting_out moved to walk.rs unchanged |
| HP-7 Tier budget | Within budget |
| HP-8 Caches | None dropped or bypassed |
| HP-9 Determinism | Total tie-breaks: distance, car nearness (total_cmp), floor. The lobby tile comes from the person's seed |
| HP-10 Save impact | None: no new fields |
| HP-11 Measured | Covered by the soak's wait comparison against main. The common-path addition is O(1) |
| HP-12 Outcome | Pass |
Nit (optional): the help line says "With no other way up, they head back down". The rider may have been going down, so "With no other way on" would cover both directions.
Reviewed against Verticopolis conventions (.github/copilot-instructions.md).
Generated by Claude Code
c9789db to
ed080ce
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
maniator
left a comment
There was a problem hiding this comment.
Independent review of #2328 at ed080ce: GO (carried from c9789db)
git range-diff against c9789db shows:
- The first commit is identical.
- The second commit has the same code. The only changes are the help nit I raised ("With no other way on, they head for the lobby and leave."), a fuller done-row for #2324, and a new open backlog row
housekeeper-service-elevator-waitslinked to the open issue #2332 (pre-existing waits found by the soak).
The section 6 record and the test-honesty checks from my c9789db review carry unchanged.
Main has gained #2329 since this rebase. git merge-tree shows no conflict, and the files don't overlap (the menu UI against engine-rs/src/crowd). Per the up-to-date rule, rebase onto main once more before merging, then wait for CI to go green.
Reviewed against Verticopolis conventions (.github/copilot-instructions.md).
Generated by Claude Code
A rider whose destination stopped being a stop mid-ride left the crowd on the next step, vanishing from the car. Now they ride on to the car's stop nearest that floor and reroute from there; a rider whose car went, or with no way on from any stop, still steps out of the trip as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7traFk8vS886Znni3dx3
A rider whose floor stops being a stop now rides to the nearest stop, gets off there and routes again from that floor. Housekeepers stay on the service elevators and stairs; a passenger with no way on leaves through the lobby instead of vanishing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ms7traFk8vS886Znni3dx3
ed080ce to
f23ff06
Compare
What & why
Closes #2324. Turning off an elevator stop made everyone riding to that floor disappear from the car on the next step: the
Ridingarm inengine-rs/src/crowd/motion.rssaw!shaft.stops_at(dest)and calledgive_up, which ends a rider's trip withfinish. That breaks the no-warping rule (nobody vanishes mid-tower). Found by the independent review of #2304 and deferred there as pre-existing.Now such a rider stays aboard, gets off at the nearest stop and finds a new way on from there (Naftali: "make sure the npc gets off at the closest stop and then has to reroute itself").
crowd::walk::ride_on_or_step_outpoints the rider at the shaft's stop nearest their floor (ties go to the stop nearer the car), and the car's cab call follows (elevator_callsreadsfloors[leg + 1]). When they step off short,walk::stepped_off_shorthands them towalk::find_way_on, which routes again from that floor:staff_shift::way_on: the staff network (service elevators and stairs), and the passenger network only for the In and Out commute;returning), so nobody vanishes mid-tower;give_up, which ends the trip at the floor they stepped off at.A rider whose car or shaft went still steps out of the trip as before (3.7.3).
Docs: the elevators help page says what happens to riders when you turn a stop off. Backlog row
stop-edit-riders-vanishadded as done.Type of change
Game mode impact
Quality gates
npm run typecheck(no TypeScript changed; CI runs it)npm run lint(CI)npm test: all 1,942 Rust lib tests pass locally, plus the backlog mirror test; the conformance, frame-day, port-edit and fuzz goldens re-recorded with no changenpm run build(CI)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 sourceComplexity
Hot paths and call frequency (tier), sizes, complexity before and after, remaining scans and why, caches kept or replaced (HP-8), invalidation evidence, measurements: n/a: the per-step
Ridingarm keeps the samestops_atcheck; the new work (one pass over the shaft's memoized stop list viaTower::stops_ofand one route search) runs only on the step a rider's floor stops being a stop, a player edit, not per frame or per tick.Hot-path record (section 6): to follow from the review.
Screenshots / recordings
n/a: no rendering change; the gallery does not stage a stop edit with riders aboard.
Notes for reviewers
Three rule tests in
rule_tests::crowd: a rider rides on to the nearest stop and walks the rest (fails on main, where the rider vanishes); a housekeeper stays on the staff network; a rider with no way on leaves through the lobby. The last two fail with the first head's code.is_still_setting_outandturn_backmoved towalk.rsunchanged to keepmotion.rsunder 500 lines (488).Soak (5 game days, both maxed towers, 4 stop-toggle seeds, main vs PR): cab vanishes 59 to 82 (Classic) and 230 to 856 (Modern) went to 0, nobody stayed stuck aboard, and 4-hour waits match main. Housekeepers waiting 4 to 8 hours for service elevators also happens on main, and is #2332.
https://claude.ai/code/session_01Ms7traFk8vS886Znni3dx3
Generated by Claude Code