Version changelog
This virtual city runs
24/7: virtual time is
≈560:1 (nominal 600; one virtual day ≈ 2.4 real minutes) and everyone sees the same city.
Below are the features added and fixed in each release.
English entries are condensed translations of the Chinese changelog at versions.html;
the Chinese page remains the authoritative, unabridged record. Current online city: Shanghai (the Shijiazhuang site was taken offline on 2026-11-04; historical entries are kept as written).
v1.6.19 Current Real weather
Released 2026-11-14 · build 202611141135
- [1 · Tomorrow's forecast]
/api/weather now also injects tomorrow's conditions (weather, high, low) into env.wxForecast, saved with the snapshot.
- [2 · New fields]
/api/state and /api/citizen expose weatherTomorrow, tempTomorrowMax, tempTomorrowMin.
- [3 · Diaries look ahead] Daily-record prompts include tomorrow's weather, so residents naturally think about tomorrow ("colder tomorrow, bring a thicker coat / no umbrella needed").
- [4 · Verified] Shanghai "light rain 19°C / tomorrow cloudy 15-20°C" -> 149 of 150 pilot diaries mention tomorrow's weather naturally.
v1.6.18 HistoryCurrent Real weather
Released 2026-11-14 · build 202611141131
- [1 · Weather follows reality] Every 12 hours the real Shanghai conditions (weather, temperature, precipitation) are fetched and injected into the virtual city via
/api/weather.
- [2 · Locked] Once injected, the city weather and temperature no longer drift or randomise with the simulation; cold snaps, rain and heat match reality.
- [3 · Survives restarts] The real-weather state is stored in
env.wxReal inside the city snapshot.
- [4 · Verified] Shanghai "light rain 18°C" -> city weather "light rain", 18°C, unchanged after a restart; citizen profiles and daily diaries reflect it.
v1.6.11 HistoryCurrent Families
Released 2026-11-14 · build 202611141037
- [1 · Three marital states] Single / married / divorced: married creates a spouse (a citizen, same district, sharing the surname); divorced only marks the person.
- [2 · Children, two options] Children can join the city (created as citizens with the given name / gender / age and parent links) or live in another city (recorded only); chat and diaries refer to the real arrangement.
- [3 · Parents at home] Choosing parents-at-home creates a father and mother (same district, ages derived from the person) and links the person as their child.
- [4 · Persona-first] Dialogue, chat and diaries are all prompted with the full persona (family / hobbies / routine / goals / speech style) and are forbidden to invent people outside it.
v1.6.10 History Families
Released 2026-11-14 · build 202611140041
- [1 · Divorced] New marital state "divorced": the person is marked as divorced and no spouse is created.
- [2 · Children, two options] Children can join the city (created as citizens from the given info) or live in another city (recorded only).
- [3 · Child info] Name / gender / age can be entered per child.
- [4 · Verified] Zhao Ming (divorced, two children at home) and Sun Li (married, one child elsewhere) both match the settings.
v1.6.9 History Families
Released 2026-11-14 · build 202611140039
- [1 · Spouse and children join] New
/api/spawnkin: creates spouse and children from the persona and links the relationships.
- [2 · Same district] Spouse and children live in the same district, sharing the family surname.
- [3 · Verified] After Sun Li joined, his spouse "Sun Yueran" appeared in the city as well.
v1.6.8 HistoryCurrent Personal avatars
Released 2026-11-14 · build 202611140011
- [1 · Education is editable] Chosen at creation, and can be changed anytime in the persona settings; gender and birth year remain immutable.
- [2 · Higher degree triggers a re-job-search] Raising education re-runs job selection against the new education/abilities and recomputes level, person–job fit and income (same flow as the government-job repair).
- [3 · Effective immediately] Saving syncs to the city at once, no next-day wait.
- [4 · Verified] Zhou Yuan: bachelor · unemployed -> PhD -> job becomes "civil servant".
v1.6.7 HistoryCurrent Personal avatars
Released 2026-11-14 · build 202611140005
- [1 · Education field] The avatar wizard now asks for education (junior high or below / high school / college / bachelor / master / PhD), stored in
hl_vp_avatar.edu.
- [2 · Spawn carries it]
/api/spawn accepts edu (0–5); the city profile shows the same education after joining.
- [3 · Editable and synced] Education can be changed in the persona settings; saving syncs it to the citizen immediately via the spawn update branch (by engine_id).
- [4 · Verified] Joining with "master" ->
/api/citizen returns master; changing to "PhD" updates it at once.
v1.6.6 HistoryCurrent Personal avatars
Released 2026-11-13 · build 202611132209
- [1 · Spawn API] New
POST /city/api/spawn: inserts a citizen with a given name / gender / birth year into the city arrays (same fields as a migrant) and returns engine_id, district and the join day.
- [2 · Name persistence] Custom names are stored in the snapshot meta (
customNames / personaIds) and survive restarts; /api/citizen resolves them.
- [3 · Wired into the avatar flow] "Start their life" now really joins the city; older records are healed on first visit to /vip/home.
- [4 · Verified] Population +1, name/gender/age/education/job match the submission, and the citizen survives a restart.
v1.6.5 HistoryCurrent Clock sync
Released 2026-11-11 · build 202611111728 · running at 1:1; the city calendar follows the server clock
- [1 · Real calendar] At 1:1 the date, weekday and time are taken from the server clock instead of being derived from "day 20,325"; seasons and weekend checks follow the real calendar too.
- [2 · Clock alignment] On boot the fractional part of the virtual day is aligned to the current time of day (day flips at midnight), so citizens' routines match real time.
- [3 · UI] The city header now reads "Year 2026 / Wed, Nov 11" with a clock synced to the server (measured 17:31).
- [4 · Rollback] Set
CITY_TIME_SCALE back to 600 and restart; the calendar returns to the day-count basis.
- [5 · Map dots] The moving dots (commuting / at work / on dates) used to run on the browser's own 600:1 clock; they now follow the server vday (real time) with per-frame interpolation, so motion is smooth instead of jumping once a second. The "slow dots" toggle became "Follows server time".
v1.6.4 HistoryCurrent Clock speed
Released 2026-11-11 · build 202611111618 · now running at 1:1
- [1 · Clock slowed to 1:1] The engine's floor for the time scale went from 60 to 1 (
CITY_TIME_SCALE=1); live now: 1 real second = 1 virtual second, 1 virtual day = 24 hours. One virtual day advances per real day — the groundwork for personal avatars that live on real time.
- [2 · Wall-clock snapshots] Snapshots used to fire every 300 virtual days, which would mean 300 real days at 1:1; a wall-clock snapshot every 4 hours is now in place.
- [3 · Data continuity] After the restart, vday 20325 and population 487,403 match the pre-restart state (resumed from the snapshot); measured 0.000695 virtual days in 60 seconds — exactly 1/86400.
- [4 · Rollback] Set
CITY_TIME_SCALE back to 600 in systemd and restart; the code accepts any value ≥ 1, no code rollback needed.
v1.6.3 History English version Site
Released 2026-11-05 · build 202611051243
- [1 · English version launched] New English city page /city/sh.en.html: it shares the same engine, the same population and the same
/city/api as the Chinese page; the interface, citizen profiles, schedules, events and the census modal are translated, and personal names are romanised (Yang Junkai).
- [2 · Five English sub-pages] changelog · sample dataset · message board · wealth ranking · city selection; each with a 中文 / English switch.
- [3 · Engine itself unchanged] Only the version constants changed (APP_VERSION / APP_BUILD / APP_DATE / APP_NOTES); simulation logic, snapshot format, API fields and the database are untouched. After the restart, vday 16754 and population 527,618 are exactly as before (resumed from the snapshot, no rollback);
/api/ping 92 ms.
- [4 · Compatibility] The Chinese page and
client.min.js are byte-identical; the survey team's basis (vday + population + sampling parameters) is unaffected.
v1.6.2 History Snapshot performance Stability
Released 2026-11-03 · build 202611030030
- [1 · Fixed the snapshot stalls that kept restarting the engine] Every snapshot (hourly, 144 MB) used to block the event loop completely, so
/api/ping went unanswered and the watchdog restarted the process after 5 missed checks — 4 restarts on 11-02 alone (02:18 / 17:17 / 21:17 / 23:16), each leaving the city frozen for about 2 minutes and hanging the sampling API as well.
The root cause was that the same snapshot took anywhere from 4 s to 187 s (a 40× swing at a constant file size), i.e. not a data-volume problem but GC pauses during serialisation.
The whole path is now sliced into small steps that yield to the event loop: during a snapshot /api/ping stays below 100 ms (worst before: 1110 ms), and internal event-loop lag fell from 776 ms to about 88 ms.
- [2 · The five specific cuts] ① the 65 citizen-state arrays now yield once per array; ②
meta pieces (54k couples, 200k newborn surnames, 560k case slots) were serialised in one 288 ms block and are now produced in batches; ③ the couple map is an object {map,info}, not an array, and used to fall into a 110k-item one-shot serialisation (the deepest spike, 1.17 s) — now split and batched; ④ state conversion no longer allocates a 560k-element temporary array per array (65 large objects, GC pauses); ⑤ disk writes went from 200+ small writes to 2 MB chunks, and the final rename is asynchronous.
- [3 · Snapshot format unchanged, zero progress lost] Old and new snapshots read each other. Verified: all 65 arrays read back, file offsets land exactly at the end, and after a restart
vday and population match the values written before (15,322 · 538,449), with no missing-field warnings.
- [4 · Four observability fields]
/api/state now exposes lastSnapshotAt, lastSnapshotDay, lastSnapshotReason (manual / scheduled / exit) and processStartedAt, so an external monitor can tell whether a restart resumed from the latest snapshot or rolled back (day < lastSnapshotDay means rollback). (Added at the survey team's request, 2026-11-02.)
- [5 · The exit path stays synchronous] On SIGTERM the process must exit immediately, so that path keeps the original synchronous build + atomic replace, guaranteeing a complete snapshot on shutdown.
v1.6.1 History Personality comparison
Released 2026-10-23 · build 202610231259
- [1 · Partner fit is now computed for the actual pair, with a five-factor breakdown] The profile used to show a single stored “partner fit” (for the closest relationship), so it did not change when you switched comparison targets. Now each pair is scored on both people's personality archetype / ability / education / income / age, and a different partner gives a different number. The score is broken down into personality compatibility / ability match / education / income / age, each with a similarity value and weighted contribution.
- [2 · Comparison targets can be switched] Spouse, lover and affair partner are all listed in a switch bar at the top of the modal; with several lovers, click to cycle through them.
- [3 · Parents can be comparison targets too] Besides spouse and lovers, father and mother appear in the switch bar, so minors and unmarried citizens can compare with their parents.
- [4 · Deceased or ended relationships are hidden] Deceased parents and ended relationships no longer appear, so there are no dead entries that do nothing when clicked.
v1.6.0 History Real road network Personality data
Released 2026-10-20 · build 202610200310
- [1 · The map now uses the real road network] Streets are the measured OSM network: a 25,143-segment skeleton (including 507 road names) plus middle and fine layers — 4 levels loaded on demand. Road names appear when zoomed in, and maximum zoom went from 16 to 64.
- [2 · Citizens commute along roads] White dots follow real roads for all four legs: to work, back home, evening out and evening return.
- [3 · Dots start from real residential buildings] Origins are now 69,455 measured residential buildings (8,000 in the light build, loaded asynchronously on demand).
- [4 · Time jump] Add
?hour=8.5 to the URL to jump straight to the morning rush and watch commuting.
- [5 · New “personality match” report] Click “Partner fit” in a profile to open a two-person personality comparison: 83 indicators side by side, 8 dimension summaries and the 12 biggest differences.
The report shows both partner fit (do they get along) and personality similarity (are they alike), and cycles through multiple partners or lovers at the top.
- [6 · Every citizen has their own personality data] All 579,021 living citizens have their own 83-trait profile; newborns inherit from their parents and have data from birth.
- [7 · Inheritance wording] “Inherited the father's estate” / “Inherited the mother's estate” as appropriate.
- [8 · Other UI] The message board became a modal; campus labels were fixed (shown only at large scale); citizen dots are easier to click when zoomed in.
v1.5.8 History
Released 2026-10-18 · build 202610181910
- [1 · New optional API parameters and fields] ①
/api/surveySample supports ?random=1 (random coverage of the whole table instead of systematically missing the tail); ② /api/citizen supports ?strict=1 (404 when an id is not found instead of returning a random person); ③ both now return a coverage field; ④ /api/state returns a switches field with the values actually in effect.
- [2 · Fixed “migrants' hukou reset after restart”] Every snapshot restore used to recompute migrants' hukou as “local”, wiping the “migrant resident” value written at runtime. Now a value present in the snapshot is kept, and only a missing field is rebuilt.
- [3 · One-time correction of polluted data] Only the 1,072 people who migrated after the switch day were corrected; the 37,033 who migrated before it were left as-is. Result: local hukou 62.90% → 62.83%, migrant residents +409. The old snapshot is backed up and rollback is possible.
- [4 · Performance: the slow-down over long runs is fixed] The four log buffers now use amortised trimming; simulation speed under full load improved by about 2.5× (20 s → 8 s per day on average).
- [5 · How to quote the hukou share] Always give four things: current actual | calibrated 60.3473% | difference | status (rule changed, stock not recomputed, converging slowly). Do not write “fixed” just because the rule changed.
v1.5.7 History
Released 2026-10-17 · build 202610172209
- [1 · Three new citizen fields: migration flag and arrival day] Any profile now shows
migIn (arrived during the simulation), migDay (arrival virtual day) and bornDay (birth day). Three classes: migrants migDay ≥ 0; founding population migDay = -1 and bornDay = 0; born in the city migDay = -1 and bornDay > 0.
- [2 · New “virtual city wealth ranking”] Three rankings — individuals (incl. net housing value), households (members combined) and individuals by pure financial net worth — plus a city overview (mean / median / Gini / top 1% and top 10% share / home-ownership rate / negative net worth / total mortgage balance). Computed once per virtual month, with month-on-month rank changes. API
/api/wealthrank, page /city/wealth.html.
- [3 · Migrants' hukou derived by ratio] Migrants are no longer all counted as “local”; their hukou is derived with the same ratio as ordinary citizens (about 60% local / 40% migrant). Applies to new migrants only; the existing ~37,000 keep the old basis.
- [4 · Fixed “the same person penalised twice for migrating”] In the crime-risk model “migrant ×1.25” and “migrant ×1.35” could both apply (×1.69); they are now mutually exclusive.
- [5 · How to quote the hukou share] Give numerator / denominator / benchmark: 62.8% (full engine count, including uncorrected stock) | benchmark 60.3473% (2024 Shanghai statistical bulletin, “registered residents / total residents”) | difference +2.5pp.
v1.5.4 History
Released 2026-10-16 · build 202610161621
- [1 · Fixed “one divorce, one house vanishes”] Divorce property division now works as in reality: one party keeps the home, the other receives cash compensation. The keeper takes over the whole mortgage and pays the compensation out of their own wealth — no money is created — and the party losing the home is barred from buying for two years. The fix sits behind an independent switch, off by default in this release (online behaviour unchanged).
- [2 · Four new independent measurement products] Health / criminal justice / housing / education each get their own statistical products (4 kinds, 8 files) so changes in these areas can be verified separately from the main output.
v1.5.3 History Education
Released 2026-10-16 · build 202610161113
- [Fixed a directional bug: “the younger, the less educated”] The engine used to write education once at 18 under a rule capped at “associate degree”, and never recomputed at the 22 and 25 unlock points — so the 18-year-old snapshot became a lifetime cap. Cohort born inside the simulation had only 2.9% with a bachelor's or above, against 15.2% in the founding generation (≈ the census) — parents far more educated than their children, the opposite of educational expansion. The marginal distribution looked right (≈33.9% with an associate degree or above), which hid the cohort error.
- How it was located: ruled out quantile compression, ruled out a mapping error, then compared person by person and found 24.5% of 25–45-year-olds stored below what their age entitled them to.
- Fix: recompute at 22 and 25 (behind a switch, off by default). Measured on the same population: bachelor's+ 13.41% → 15.60%, concentrated among the young — ages 20–29 went from 4.2% to 17.1% (about 4×), while the 40+ barely moved. Exactly what a fix should look like: only the generation still growing up is affected.
- Note: only the 18-year cap was lifted; there is no “younger = more educated” cohort effect, which would need education by birth year — Shanghai does not publish age × education, a known data gap. The fix is forward-looking: existing citizens' education is not rewritten, and the improvement appears gradually in virtual time.
- [Fixed a crash that could stop the whole city] When a loaded snapshot was missing the per-person “priors” or “in custody” arrays, the criminal-case step threw and the city stopped. Missing per-person arrays are now always padded to the population — never thrown.
- [Continuing education: no age limit] The engine now really records enrolment and supports retakes, top-up degrees, self-study exams, adult entrance exams and in-service study. Measured enrolment ages: 20–24 29.7% · 25–29 34.4% · 30–34 12.4% · 40–44 6.9% · 50+ 2.6%; oldest entrant 60, mean 29.2.
- [Engine] 13,123 lines (~890 KB, 12,876 non-empty). This release's engine changes are the education cohort structure and snapshot compatibility, each behind an independent switch or “pad if missing” — off means byte-identical behaviour to the previous version.
v1.5.2 History All-stage education
Released 2026-10-15 · build 202610151828
- [All-stage education: enrolment, grade and exam gates] A profile can now show which grade a child is in: stage and grade under the real school system (e.g. “in university”, “in master's”), with same-age children in different grades — the enrolment cut-off date (those born in the second half of the year start a year later, about one third) plus a little grade repetition and skipping.
- Exam gates — the profile shows the citizen's actual primary-to-junior-high / high-school / gaokao outcomes, e.g. “High-school entrance exam: admitted to a key city high school”, “below the general-track cut-off, went to a vocational school”. These are events recorded while the city runs, not reconstructed afterwards.
- Daily routines follow stage and grade: in primary school, lower grades focus on literacy and pinyin and upper grades on the transition exam; final-year university students do a thesis and job-hunt or prepare for graduate school.
- [School supply can be set per stage] Previously the school level only affected ages 15–25. It can now be set separately for kindergarten / primary / junior high / high school / university, each affecting its own age band. Off by default: without configuration behaviour is unchanged.
- [Campus layer: real names and coordinates] 66 real Shanghai universities prepared (OpenStreetMap), each verified to fall inside its district — enabled on the map later in this release.
- [Continuing education: no age limit] “Enrolled” used to be a display estimate and stopped at 22. The engine now truly records enrolment and supports retakes, top-up degrees, self-study, adult entrance exams and in-service study: you can see 30-, 40- and even 50-something citizens actually studying, with education rising step by step (a bachelor's student always has an associate degree first).
- Measured over 50 offline years (5,000 people, 1,660 enrolments): 20–24 29.7% · 25–29 34.4% · 30–34 12.4% · 35–39 9.8% · 40–44 6.9% · 45–49 2.9% · 50+ 2.6%; oldest entrant 60, mean 29.2; average enrolment about 54 people, all adult continuing education.
- Four criteria all pass: no age limit ✅ · no skipped levels ✅ · long-tailed age distribution ✅ · stable over the long run ✅. Long-run effect: “associate degree or above” rose from 28.3% to 31.8% over 50 years (+3.5pp) — continuing education working, not grade inflation.
- [Campus layer live] The 66 real universities are now drawn on the map with real names and coordinates (OpenStreetMap, ODbL, credited on the map), matching real geography (dense in Yangpu, Xuhui and Songjiang university town). To turn it off:
?campus=0 or localStorage.setItem('campus_layer','0').
- [Fixed a bug that could freeze the map] The campus layer is decorative, but a drawing error used to stop the whole map render loop (the picture simply stopped refreshing). It now disables only itself on error, leaves a console note, and the map keeps running.
- [Two real-value fields in the citizen API]
/api/citizen now returns enrolled and enrollEnd — the first step from a display estimate to actual engine state.
- [Better runtime observability] The memwatch log line now carries average times per day and per person, so you can tell whether simulation speed is normal without inferring from timestamps (the line has none).
- [Engine] 13,067 lines (~890 KB, 12,820 non-empty). Changes: all-stage education (stage/grade/enrolment derivation, per-stage school supply) and the continuing-education channel (enrolled / expected graduation, stepwise progression and return after interruption). New randomness is derived from citizen ids and consumes no random stream; the continuing-education channel is off by default and off means identical to the previous version.
v1.5.1 History Hukou
Released 2026-10-13 · build 202610131144
- [Hukou tiers corrected to the official basis] The “city / county-seat / rural” three-tier scheme in v1.5.0 was wrong and is corrected here. Shanghai has no “county” — Chongming became a district in 2016, and all 16 divisions are districts; “county / town” is an administrative level, not a hukou type, so the “county-seat” tier had nothing to map to.
- Worse, the 72/28 split between “city” and “county seat” had no official source: it mixed two orthogonal statistical axes — the urbanisation rate 89.85% belongs to “non-agricultural / agricultural”, while “registered / migrant resident” belongs to “local / non-local registration”. Subtracting one from the other to invent a middle tier produces a number with no real counterpart.
- [Shanghai has two tiers] Per the 2024 Shanghai statistical bulletin: local hukou 60.35% (14.9677M registered residents) and migrant residents 39.65% (9.8349M) — together 24.8026M = 100%, a complete split of the resident population. Official definition: migrant residents are people from other provinces who have left their place of registration for more than six months, hence necessarily non-local hukou.
- [Why there is no “rural” tier] The official data does not publish a separate agricultural-hukou count for Shanghai. A three-tier scheme would require assuming all 9.8349M migrants are non-agricultural, which has no official basis — better to omit than to guess.
- [Other cities can still use three tiers] Tier definitions are now declared by each city; the engine assumes nothing. Cities with counties (Shijiazhuang, Chongqing, Xi'an, Chengdu …) declare city / county-seat / rural hukou from their own bulletin; cities without counties (Shanghai, Beijing, Tianjin, Wuhan …) use two or three tiers depending on what their bulletin publishes.
- [No effect on the simulation] Hukou is a pure label here (used only for stratified survey sampling), has no behavioural effect, and is derived by hashing (seed, id) without consuming the main random stream — so city building and trajectories are identical to the previous version; only the labels and the documentation changed.
- [Also fixed a front-end defect] The top-bar version number used to show a stale built-in constant because the API's version fields were never written back to the object the page reads. Fixed, and the missing version notes (APP_NOTES) are now returned, so “📄 Version” shows the real notes.
v1.5.0 History Justice Civic systems
Released 2026-10-12 · build 202610122200
- [Justice system] The city gained a complete dispute-resolution chain: a four-stage funnel (negotiation → mediation → arbitration → litigation), contracts, appeals (second instance), and judge posts with statutory education thresholds. All calibration anchors come from public sources: Shanghai litigation rate 347 per 10,000 per year, pre-trial diversion 57.01%, voluntary compliance 95.36%, appeal rate ≈11% (89% accept the first-instance ruling), small-claims ceiling ¥73,099.50 (final), enforcement recovery 54.29%. Judge thresholds follow the Judges Law (bachelor's + legal qualification + 5 years of legal work; quota system). Verified: 0 judges among the 1,475 citizens below bachelor's level (full scan of 1,721), no drift over 6 annual re-checks, appeal rate 11.4% against the official 11%.
- [Hukou classification] Split into city / county-seat / rural (urbanisation aligned to the 2024 Shanghai bulletin, 89.85%), with survey sampling stratified by hukou; migrants take the city label and newborns follow the mother. Measured: city 65.85% / county seat 24.32% / rural 9.83% ⇒ urbanisation 90.2%. (Corrected to two tiers in v1.5.1.)
- [Causes of crime] Crime used to have types and consequences but no individual motive — who got caught was essentially uniform random. Every citizen now carries a risk multiplier: economic pressure (debt, bankruptcy, household payment gap), unemployment × vulnerability (rural hukou, migrants), health shocks, personality and mood, job seniority, relationship conflict. Directions are calibrated to the literature (Zhang Yuan et al., Economic Research 2011: unemployment, not income inequality, is the main driver, through vulnerability). Multipliers are mean-normalised, so they change who is more likely to offend, not the total. Measured: unemployment ×2.39; unemployed with rural hukou 26.9% higher than city hukou; ¥100k debt ×2.36; rank ≥5 ⇒ case value ×3.25. Honest caveat: except for the unemployment × vulnerability direction, all multipliers are model assumptions — China publishes no authoritative “a ¥100k debt raises crime by X%”.
- [Housing: three real defects fixed] The default test never checked whether a mortgage was actually outstanding, so outright owners could lose their home for “failure to repay” when net worth turned negative. After the fix, household ownership rose 9.49pp (y12: 28.0% → 37.5%) and defaults fell 63%.
- Stock owners were never initialised: the online city always resumed from a snapshot, while city-building calibration only ran on day 0, leaving ownership at 2.54% (14,448 of 14,506 owners had a mortgage). A one-off stock bootstrap (keep existing owners, fill in the missing stock) took it to 47.5%.
- Property was not inherited: estates distributed financial wealth only, so housing drained away as generations turned over. Property and the remaining mortgage now transfer in statutory order (spouse → children → parents); with no heir the home is left vacant.
- [Government ledger persisted in snapshots] The ledger used to be outside the snapshot, so every restart reset the treasury to zero and the metro (about ¥2.4B per level) could never be afforded. The ledger is now written into and restored from the snapshot; after a month boundary the snapshot meta contains
gov with the treasury of ¥1,643,698,145 intact.
- [Manual interventions no longer “fake success”]
/api/intervene used to discard the result and always return {ok:true}, while an unaffordable policy changed nothing — so the UI could not tell success from a budget rejection. It now reports ok / applied / reason / need / treasury.
- [Verification and records] Eight verification rules were written down, the most important being “absence from the log ≠ it did not happen” — application logs are redirected to files rather than journald, which once led to a false “the ledger never ran” and three pointless deployments. Suites: justice 9 suites / 135 assertions, crime causes CC-1..8, hukou HK-1..10, inheritance HI-1..7, matchmaking B2-A..H, government-ledger persistence — all pass; behaviour matches the previous version (all new features off by default).
v1.4.0 History Data verifiability Banking
Released 2026-10-11 · build 202610111400
- [Data basis · verifiability] The main theme is making the city's numbers checkable from outside. Anonymous export: new
anon=1 — each individual gets only a non-reversible anonymous id (hash, stable under a fixed salt and therefore citable); names and internal ids are never exported; without the parameter behaviour is unchanged.
- Fixed salt: the salt comes from a server environment variable, so a requester cannot change ids with their own salt (otherwise the same person would have different ids across exports and datasets could not be aligned or cited).
- Time-series archive: all engine logs used to be rolling buffers (births/deaths covered ~100 virtual days, city indicators 200), so “who married five years ago” had no answer. New append-only disk archive for city indicators plus 19 kinds of individual key events (marriage, divorce, birth, death, employment, unemployment, crime, bankruptcy …), with a read-only export API. The archive starts at build time (1 virtual year ≈ 14.6 real hours), so a five-year window needs about 3 real days.
- The archive never records event text (which contains names), so there is no name leakage by construction rather than by stripping at export time.
- [Banks actually start lending] Banks previously had books only. Mortgages are now aggregated into bank assets per household, and firms borrow or repay depending on whether retained earnings cover investment — reconciled person by person.
- [Credit rationing (quantity constraint)] Lending is capped by Shanghai's 53% loan-to-deposit ratio (a fund-collecting centre, far below the national 80%). Excess demand is rejected at the same rate — that is rationing.
- [Interest has a source and a destination] Interest paid by borrowers = interest received by depositors + the bank's net interest margin: ¥109,000 total, of which ¥77,000 to depositors and ¥32,000 margin. Household wealth finally has a counterparty.
- [Mortgage rates use real rates] The monthly rate is benchmark + spread (3.50%) instead of a fixed 4.50%; effective only when the finance layer is on.
- [Research findings — three new report sections] Policy stacking: birth subsidies and housing controls stack almost completely (measured ratio 1.01) — they work through different channels, so both can proceed without waste.
- Fiscal efficiency: measured from the ledger, each additional birth costs about ¥3,900 of public money per year.
- Decomposition of the four gates: what limits births is not marriage, age or birth spacing (each worth about 5%) but the “target parity” itself (+87.8% when released) — which explains why subsidies add only about +4.2%: policy can help people reach their target, not change the target.
- [Engine] 10,191 lines (~700 KB, 10,020 non-empty). Adds one engine capability (inject a new citizen from supplied data) and removes legacy duplication and placeholders; the new capability is off by default.
- [Finance system, phase 1] The city now has banks. Household wealth used to be a floating number that earned a return nobody paid; the bank fills that slot — assets are loans, liabilities are deposits, and the interest households receive comes from borrowers.
- [Rates on a real basis] Benchmark 1-year LPR 3.00%; mortgages 3.06%, corporate loans ~3.10%, deposits 1.31% (all from the PBOC Q1 2026 monetary policy report), plus capital adequacy 15.26% and reserve requirement 6.2%. Shanghai's 51–53% loan-to-deposit ratio is used as published.
- [Accounting error fixed during development] The first version treated part of household wealth as bank deposits, which makes equity negative — impossible. The cause was that household wealth includes real assets that are not bank liabilities. The model now records “loans create deposits”: each ¥1 lent creates about ¥1.89 of deposits, reserves balance by identity, and equity is always zero (pure intermediation). Verified against synthetic data: loan-to-deposit ratio exactly 53%, interest flows balance.
- [How wages are set — the first real mechanism] Wages used to be a coefficient updated by era. They are now determined by the marginal product of labour, with nominal wage stickiness: wages adjust in staggered batches (Calvo 0.33 per quarter ⇒ about every 4–8 months), so they lag productivity by an amount set by the stickiness.
- [Where firms' money comes from and goes] New firm cash-flow accounts: output − wages − tax = retained earnings; comparing that with investment (33% investment rate, World Bank basis) shows whether a firm needs external finance. At a 20% tax rate retained earnings suffice; needs appear only around 30%. Capital stock accumulates as investment − depreciation.
- [Inflation suppresses the economy] Prices used to be just a number. Fast inflation now makes firms invest less and households save less and bring purchases forward (inflation hedge). Both channels scale by calibratable coefficients, and deflation automatically reverses the direction.
- [Enabled in this release] Technical growth, endogenous breakthroughs, wage setting, firm accounts, inflation suppression and banking are all switched on and running: incomes rise, life expectancy extends, technology jumps with R&D accumulation, and mortgages use real rates. To avoid double counting, “capital deepening” and “wage setting” are mutually exclusive (mathematically equivalent).
- [A severe defect fixed] While enabling the systems, a hidden but fatal problem surfaced: the startup parameter bridge overwrote the whole economic parameter table with a boolean, silently disabling the economy and banking systems — “enabled” on the surface, nothing actually running. Introduced in the previous release and latent for hours; fixed, and an external endpoint now reports each mechanism's switch state.
- [Single source for the version number] The version was hard-coded in at least six files. The engine now provides it and pages read it, so one edit updates the whole site; also fixed stale static-asset version parameters that kept browsers on old files.
v1.3.0 History Government layer
Released 2026-10-08 · build 202610081100
- [Engine] 7,148 lines at release.
- [Fixed] Custody logic: citizens arrested awaiting trial or serving a sentence still started relationships, dated, broke up and had affairs — the dating branch never checked custody status, and the profile schedule stacked dates on top of the cell routine. Both simulation and display now check it: detainees neither produce nor show dating events.
- [Fiscal] Construction and upkeep used two price scales: construction hard-coded (metro ¥250M per level) and upkeep at real asset value (¥18B per level) — 17–72× apart, so “building once is far too cheap ⇒ money never runs out”. Unified to real asset value, computed once and read from three places (including the external probe, so probe and calculation cannot disagree).
- [Infrastructure] “1 level = 500 ha of green space” is 1,250× the national standard for a 2,500-person city (10,000 ㎡ per person against a standard of 8 ㎡) — the smaller the city, the more absurd. Now scaled per capita: green space anchored to the National Garden City standard of ≥8.00 ㎡ of park per person, hospitals to 6 beds per 1,000; metro and school anchors have no published standard and are labelled model assumptions.
- [Gating] Green space now has a minimum-population gate like metro, hospitals and schools (previously a small city was still required to build 500 ha).
- [Tooling] New consistency checker: timeline monotonicity, no dating while in custody, no events after death, no event before birth; and it distinguishes “passed” from “not run” — a missing field reports not-run rather than a false pass.
- [Note] The custody fix applies by default; fiscal, infrastructure and gating are behind switches (off in source), but this demo instance has all of them enabled, so city behaviour has changed accordingly.
- [Live] The government layer is public on this demo instance: the city now collects taxes, is budget-constrained, prioritises infrastructure by gap, pays upkeep and lets facilities depreciate. Its “fiscal tightness” matches the real world — infrastructure spending is a small share of fiscal revenue (for reference, Shanghai's entire park green space stock ≈ 0.17 years of fiscal revenue), so do not expect visible strain; forcing strain would invert the conclusion.
- [How to see it] The 🏛️ City government bar at the top of the Shanghai view shows monthly tax, monthly upkeep, treasury balance, revenue/upkeep ratio, and the current levels of 🚇 metro / 🏥 hospitals / 🏫 schools / 🌳 green space.
- [Note] The government layer settles only at virtual month-end (
day % 30 == 0), so early in a month amounts may show “—” while levels remain visible — normal, not a fault.
v1.2.0 History Calibration
Released 2026-10-05 · build 202610050030
- [Data] 48 city parameters moved to official values: housing price 58,994 → 55,500 (source downgraded to platform data), minimum living allowance 1,500 → 1,690, pension 3,200 → 5,542, minimum wage 2,690 → 2,740; job structure re-calibrated (civil servants had been 21.11× the official target — the project's own criterion now passes for the first time); all 12 monthly temperatures switched to meteorological-bureau values (annual mean 17.50 → 18.20°C).
- [Fixed] Three defects that produced wrong numbers: district education distribution (university+ was 3.6–6.0pp too high; now matches the census table across all 16 districts); household surname consistency (children in a family could have different surnames while “same-surname first” pairing relied on the wrong one); a report that showed the childless rate as 100%.
- [New] Policy forecasting: run a “do vs don't” comparison from the same initial state and get per-item differences with 95% confidence intervals (validated with 10 independent random streams).
- [Operations] Virtual time slowed (nominal 3600 → 600, measured ≈480:1) to cut server CPU from 63.6% to about 16%; 486 MB of stale archives cleaned up.
v1.1.1 History Households Life course
Released 2026-10-01 · build 202610012200
- [Engine] 7,994 lines, with a feature-switch system and 111 calibratable parameters (each with a source, or explicitly labelled a model assumption).
- [Marriage and fertility] Every citizen has a target parity from the 7th national census distribution (childless 10% / one child 48% / two 36% / three or more 6%); marriages form through age-specific marriage risk and partner scoring, producing a real marriage market.
- [Medical care and insurance] Hospital costs are reimbursed by insurance tier, with catastrophic cover and an out-of-pocket cap; when out-of-pocket exceeds what a household can bear, it triggers borrowing, bankruptcy and finally forgoing treatment.
- [Household ledger] Each household books monthly income − living costs − children's education − mortgage/rent − medical out-of-pocket, producing surplus or debt; home purchase and mortgages (down payment, monthly payment, default handling) and inheritance are included.
- [Scarcity of money] Money became genuinely scarce: asset-based consumption draws down assets above an emergency reserve (imputed rent for owners, durables, transfers to children, self-paid medical care); parents contribute to children's home purchase up to a cap with a retention ratio; adult children support parents monthly once parents need care; all flows are monthly.
- [The household as a first-class entity] Housing and housing costs settle per household: living with parents means no rent (local young people often stay until marriage), and moving out happens only when income supports rent or a purchase — the decision is the rent-to-income ratio, which is the real mechanism behind “boomerang children”. Young people without parents nearby and without enough income share flats, splitting rent by the number of occupants (up to 4). Owners are not charged rent twice. Intra-household transfers (parents' help, support for parents, care for frail parents, grandchild care) settle within the same household at equivalent scale.
- [Family life cycle] Care for frail parents is shared by adult children through money and time, depending on siblings and income; living alone with poor health raises mortality above otherwise identical co-residents and lowers mood; grandparents caring for grandchildren relieve the middle generation and improve their own mood.
- [Health behaviour] From adulthood, citizens have smoking, drinking and exercise habits by population share and age, plus annual check-ups. These act through three channels: faster or slower health decline; proportional scaling of individual mortality risk; and onset of chronic disease (hypertension, diabetes).
- [Life milestones] Schooling, employment, promotion, demotion, job change, marriage, births and death are all recorded and traceable in the profile.
- [Public safety and sentencing] Criminal cases have a full consequence chain: filing → pre-trial custody → trial → suspended or custodial sentence → release → criminal record. Serious cases are detained pre-trial, minor ones released on bail. A detainee's “today” is a day inside the cell block (education and exercise while awaiting trial; labour and skills training while sentenced), showing the charge, sentence, months served and days remaining. Profiles show custody status, charge, case stage (awaiting trial / sentenced / closed) and prior convictions. Detainees are not drawn on the map and cannot work or marry while held; a sentence strains the marriage. Economic cases go through the same chain.
- [Protection of minors] Criminal cases are limited to ages 18–70; minors are never detained but handled by “ordering guardians to discipline strictly” with guardian liability (fine plus a household record); sexual orientation is hidden before 18 (shown as “undetermined”).
- [Saves] Housing, mortgages, parity, fertility targets, case records, custody, priors, bankruptcy, consumption and education spending are all saved per person, so a restart resumes exactly.
- [Today's schedule] Times are strictly ordered; bedtime shifts with the end of the shift (capped at 24:00); non-round times are shown as HH:MM (e.g. 20:30, 23:30).
- [Environment and health] Air quality is calibrated to the Shanghai ecology bureau's 2024 annual mean PM2.5 of 28.4 µg/m³; the mortality effect uses a national study covering 61.22 million deaths (+0.22% all-cause mortality per 10 µg/m³). Health is now a real indicator that diverges with age, smoking, drinking, exercise, overtime and commuting; five linked effects run: driving restrictions, added green space, limited outdoor activity, respiratory deaths and air quality affecting mood.
- [Income linked to the business cycle] Incomes now move with the city's economic climate (previously independent, so economic policy could not reach household income); entrepreneurial income moves more (higher risk, higher volatility); civil-servant pay stays stable within its band (as in reality); income settles monthly and depends on climate, rank and job fit.
- [Policy sandbox] Economic policies now genuinely affect income, so “what if the economy were X% stronger” can be simulated without changing anything else; the same citizens can be compared person by person (same IDs) rather than drawing a new sample; linked to the survey platform, counterfactual questionnaire comparisons can be generated directly (same questionnaire, same people, two policies).
- [Mortgage ledger] Mortgages settle realistically: 30-year equal instalments over 360 months, principal and household cash settled together; affordability uses combined spousal income (so couples with unequal incomes are no longer misjudged as unable to buy); the payment is split in proportion to income so both bear the same burden ratio; singles and divorcees are assessed on their own income.
- [Intergenerational support] Down-payment help from both living parents (capped, with retention); monthly help only when the couple's income cannot cover the payment and household costs, topping up the gap and actually deducted from parents' wealth; parents still paying their own mortgage can help much less; grandparents give small support, with a higher cap when parents are very wealthy; adult children top up parents' income monthly when it falls below the basic living line.
- [Housing system] Owning a home is now a real economic state: the founding population's ownership is initialised at the Shanghai urban household ownership rate (~60%), including differing outstanding mortgage (younger owners owe more); four housing states — owned outright, owned with mortgage, renting, living with parents — all driven by real economic capacity and household structure; divorce division, default and inheritance settle at the district's housing price.
- [District prices] 16 districts priced separately, with a real spread: Huangpu ¥108,649/㎡ · Xuhui 80,248 · Putuo 59,185 · Jiading 37,265 · Jinshan 14,677 · Chongming 14,659 (highest to lowest 7.4×); city average ¥58,994/㎡ and a 2.05% annual rent-to-price ratio, matching official figures; rents settle by district, and purchase, default, division and inheritance all use the district price.
- [Wealth basis] New net worth including housing: property value counts towards household net worth and is output alongside financial assets; parents' ability to help is assessed on net worth including housing, so “house paid off, little cash” families are no longer misjudged as unable to help.
v1.0.1 History Matching
Released 2026-09-23 · build 20260923-1226
- Matching system: every citizen has two new indicators — person–job fit (how well ability, education and personality suit the job) and partner fit (how compatible personality and circumstances are with the spouse/lover). Person–job fit drives promotion and demotion, affects pay within a job, and determines who is more likely to be laid off or reassigned; partner fit affects how often couples argue, divorce and affair tendencies, and fertility.
- Census panel gained a “matching” block: city-average person–job fit, the share of employed people with low fit (below 0.5), average partner fit and the distribution of both (table and bars), next to age / income / migrant blocks, refreshed every virtual day.
- Profiles now show both indicators beside occupation and income, with a plain-language reading (“strong / good / average / poor match”; “very in tune / fairly in tune / still adjusting / not very in tune”).
- Population model fixes: age-specific life tables replace the old crude death-rate clamp; a target total fertility rate replaces the crude birth-rate anchor; district reassignment at build time resamples within tier (closer to the census); out-migration is age-weighted (young labour leaves more). At build time: 23.4% aged 60+, 16.2% aged 65+, aligned with the bulletin.
- Multi-city construction: the same engine builds each city's own population and economy (online: Shanghai, Shijiazhuang at the time).
- A living city: commuting times vary day to day; evening destinations branch every day (straight home / late at work / dinner and shopping / a date — the date shown is the one that actually happened in the engine); evening trips are coloured on the map by destination — 🟣 pink = date, 🟠 orange = working late, 🔵 cyan = dinner and shopping; dots are resampled every virtual day, so deaths, coming of age and new arrivals all appear.
- Migrants are generated with normal ability and education (the earlier bias was a modelling defect); migrant incomes match locals.
- Dating history: relationships, dates, break-ups, marriages, divorces and bereavements are all recorded for both parties and persist.
- This changelog page is linked from the city footer and the city-selection page.
- Offline demo (offline.html) updated to this version: the legend gained the three evening colours, dots carry the real evening destination (including the actual date), the census panel and both fit indicators match the online city, and it runs entirely in the browser.
- [Fix] Map legend: the city legend was overwritten every frame by an old string that only mentioned “gold = commuting” and never the three evening colours; online and offline now share one source.
- [Fix] Date dots are visible: hundreds to thousands of dates happen every day, but the map samples only 600 people per district (~1%) and the evening branch picks a date only 8% of the time, leaving 0–2 pink dots. Citizens actually on a date tonight are now always drawn (outside the sample quota) with the date location marked.
- [Fix] Evening destinations: district names were passed to the map where district indices were expected, so overtime / shopping / date dots all fell back to the work district (planned to go to the Bund, drawn at the office). They now land in the real district.
- [Fix] Offline demo froze on the “Economy” tab: the page referenced a local variable declared in another function and threw a ReferenceError; because the render loop registered itself after the failing line, map and clock froze until refresh. Fixed and all five tabs verified.
v1.0.0 History Launch
Released 2026-09-18 · build 20260920g
- First release: an autonomous city simulation with 1,000,000 virtual citizens.
- Built on real statistics: administrative divisions, age and education structure, industry and occupations, industry wages, housing prices and rents, climate and shift patterns — all from each city's own statistical bulletin / yearbook / 7th-census district data.
- 24/7 resident engine: the simulation runs continuously on the server, virtual time measured ≈480:1 (nominal 600); the page is only a client and everyone sees the same city.
- Any citizen can be inspected: today's schedule, life trajectory, spouse and children, shift (day / swing / night / rotating), income and rank, housing and commuting — every white dot on the map is one real citizen.
- Base systems: four-season climate and weather, economic cycles, epidemics, the housing market, policy interventions and a message board.