https://dryrun.aaryanparveen.com/video
Inspiration
The Grenfell Tower fire in 2017 exposed building safety records that were incomplete, on paper and out of reach, and no plans for residents who needed help to get out. The law has since caught up. The Building Safety Act 2022 requires every higher-risk building in England to keep a "golden thread": one digital, up-to-date record of its fire safety. Since 6 April 2026, landlords must also plan how each resident who needs help will get out.
In practice that record is still scanned drawings, out-of-date fire strategies and spreadsheets, spread across competing platforms with no common standard. Evacuation is modelled once, at design, by specialist consultants, if at all, and never re-tested as the building or the people in it change.
What it does
Dry Run turns a building's golden thread into a living evacuation test. You drag in the building's documents: plans, fire strategy, evacuation plans and timetables. A reader agent builds a 3D model of the building and fills it with the people who actually use it.
An agent-based crowd simulation then runs a fire. Every person is an agent with their own personality and needs, reacting to those around them: hesitating, following the crowd, heading for the door they came in by. You see where people queue, where smoke reaches first, and who doesn't get out. An advisor proposes changes and re-tests them in the simulation. The results go back into the golden thread as tamper-evident records for a fire engineer to sign off.
What you see in the demo:
- The building you're sitting in. The demo building is the hackathon venue, the Nancy Rothwell Building. We rebuilt it from the University's floor plan and its OpenStreetMap footprint (194 × 43 m), ground floor to third floor, with a floor selector. It opens on the whole building from outside, University sign and all, and the shell then fades away to show the floors inside.
- People with different needs. People are shared out over the rooms by Approved Document B floor-space factors. Wheelchair users are pushed by the nearest walker in their room. Slower walkers take longer. First-time visitors only know the way they came in. Deaf people move when they see others go, are told, or meet smoke.
- A verdict for every person, not just a clear time. Each person gets a minimum time to exit, a safe time to exit and the margin between them. People with mobility or sight needs are also checked against 3 times an able-bodied person's minimum from the same spot. In the recorded ground-floor run, all 100 people are out in 2:01, 29 s inside the 2:30 target. But one wheelchair user's journey took 4.3 times the able-bodied minimum, over the allowance. "Everyone out in two minutes" hides that person. Dry Run points to them.
- Heatmaps. Crowding on 2 × 2 m cells, graded on Fruin's level of service, plus time to spare and smoke exposure. They are also served as an API that returns JSON or PNG.
- The advisor is a council. Six seats, from fire engineer to accessibility advocate to red team, each propose a change: widen a door, add an exit, clear a route, add fire wardens. Every proposal is re-run on several seeds, and the best change that is better, fair and affordable is adopted. This repeats for three rounds. You can watch the seats argue and vote in a 3D meeting room. Back in the model, each adopted change is marked with a beacon and a banner showing what it bought.
- Live it. Take one person's place and evacuate in first person, in the browser or in a VR headset. The whole building can also be viewed as a table-top model in VR.
- A final report. One page with the verdict, the evacuation curve against the safe time, 3D shots from the run, the heatmaps, the busiest exits, how each group of people fared, and the rooms with the least time to spare.
- Spindle, a mock golden thread platform. We built it to stand in for the platforms owners use today. It holds the building's record: a scanned plan, a 2021 fire strategy with open items, a register of five people who need help to get out, and a timetable. It shows how complete the record is. Dry Run sends back a simulation record and a draft safety case, chained by SHA-256 hashes so an edited record breaks the chain. A fire engineer then approves or flags them, and the record's completeness score goes up.
All the building records, documents and people in the demo are synthetic.
How we built it
- Reading the venue. pdf.js extracts every coloured fill and label from the University's floor plan PDF. The map draws no room doors, so some were placed by hand and the rest are inferred by rule, with each inferred door logged with its reason. The walls drawn in 3D are exactly the walls the simulation reads.
- Reading other drawings. We also wrote a plan tracer without machine learning: Otsu thresholding, a chamfer distance transform, doorways found as short breaks in walls, and scale taken from the median door width (0.9 m). A vision model then names the rooms through an OpenAI-compatible Responses API with a strict JSON schema, and code rules stop it sealing anyone in.
- The crowd. About 6,350 lines of TypeScript, with no simulation library. People move freely in continuous space and are routed on a 20 cm navigation grid, with wall clearance measured on 5 cm cells, so a body only goes where it fits. Each exit has a fast-marched travel-time field, re-solved for crowd density (Weidmann's fundamental diagram) and smoke as the run goes on. Bodies avoid each other with ORCA, ported from RVO2. People pick an exit from what they could know: the signs in sight, the queue, and what others do. Smoke is a simple spreading model with a toxic dose, not CFD. Every run is seeded and repeats exactly.
- Safety maths. A place stops being safe once smoke hides a lit exit sign beyond about 4.85 m. A bottleneck-path Dijkstra gives each place the last moment a clear way out existed. Each person's recorded path is also checked against when each place along it became unsafe.
- The council. It follows Testa and Musse (2025), "Predicting and Optimizing Crowd Evacuations: An Explainable AI". It finds the worst crowding, then measures which factors cause it with exact Shapley values, re-running the building on combinations of up to six factors, each moved 20%, instead of using the paper's neural network stand-in. Seats propose from offline rules or a language model asked in parallel. Proposals run on 3 seeds and the best on 3 fresh ones. A change wins only if it beats the seed-to-seed noise, keeps within a £30,000 budget, and does not lower any group's share of people out by more than 2 points or push more disabled people over their allowance. Each round is sealed into a SHA-256 hash chain.
- 3D and VR. three.js with WebXR. The crowd is one instanced draw call. The exterior is generated from the plan. Headsets get a lighter table-top scene with a close near plane.
- Speed. Runs compute in Web Workers. The dev server records the sample's run once and streams a 37.6 MB recording as 0.72 MB, so it is not recalculated on every visit. The sample is built behind the landing page, with every shader compiled before you click, so it opens without a freeze.
- Spindle and hosting. Spindle's logic is shared between the dev server and a Cloudflare Worker, which keeps the record in a Durable Object. Hashing uses the Web Crypto API, so the same code runs in both. The live build is served from a dev machine through a Cloudflare Tunnel.
Challenges we ran into
- People walking through walls and each other. In the simulation, overlaps are pushed apart after every 0.1 s step (up to 12 passes), and anyone still caught is put back where they started that step. A separate test checks every step of its runs against the exact wall pixels and furniture, allowing no wall intrusion and at most 1 cm of overlap.
- Jammed doors. Our first steering model, a look-ahead "fan", clogged doorways into an arch. Over three seeds, a packed room emptying through a 1 m door passed 1.40 people per metre per second with ORCA, against 0.62 with the fan.
- Doors or corridors? In a drawing, both are gaps between walls. Our rule: a doorway lasts about one wall thickness, and when you step off the wall both jambs fall away together.
- Lucky results. The best of six noisy results flatters itself, so finalists are re-tested on fresh seeds before anything is adopted.
- VR went black. On the desktop the near clip plane grows with distance, up to 8 m, so in the headset it cut away a table a metre away. The headset now uses a 0.02 m near plane, and its materials are compiled before the first frame.
- A 13-second freeze. The first open of the venue froze while three.js compiled shaders one by one. We now build the sample behind the landing page, compile every shader there, and defer the event feed until the opening has played.
- One floor at a time. Upper floors have no doors to the street. We treat reaching a protected stair as safe, so each floor can be run on its own.
Accomplishments that we're proud of
- The building in the demo is the one the judges are sitting in.
- A simulator that won't let bodies overlap, with a test that checks every step and confirms the same seed gives an identical run.
- On a generated 1:100 test drawing, the tracer found all 12 rooms, all 4 exits and 12 of 13 interior doorways, with every printed room area matched within 1.5%.
- A council that can't win by hurting one group to help the average. Turning people away is only a last resort, ranked behind any change that fixes the building itself.
- Editing any sealed record breaks the hash chain at that record, and a test confirms it.
- Honest labels. The 2:30 target and the 3× allowance are policy choices, not regulations, and the allowance can be set to 2×, 3× or 4×. Capacity is marked "Advisory, not certified".
What we learned
- One clear time is the wrong headline. A building can pass while one person fails.
- Language models are useful for proposing changes and reading messy documents, but the simulator has to decide. Everything still runs without them.
- Most of the work in a crowd simulation is making sure nobody does anything physically impossible.
- Fast first impressions matter: building the scene before the click mattered more to the demo than any single rendering trick.
Built With
- ai
- three.js
- vite