Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ All notable changes to Econ-Engine are documented here. The changelog records wh
- Leaves follow the season: bilberry, hazel and birch blend from spring green through autumn yellow and brown to bare winter crowns; about half the trees are drawn as birches and half as evergreen pines, by a hash of the tree's number. The grass dulls in late autumn and winter. Colours change through shared shader uniforms, recoloured at most every tenth of a day.
- Observer only: the simulation's day still runs from `dawnHour` to `duskHour` all year, and trajectories and fingerprints are unchanged. New `seasonLook.ts` with unit tests; the fixed-day `daylightAt` and `sunAt` in `display.ts` are removed.

## [LIFE18-Seasons-076] - (2026-11-03)

- Life 18, seasons and stores. The calendar counts days of the year from the spring equinox, and founders arrive at 330‰ of the year, the first day of the berry season. Berries ripen from 330‰ to 450‰ of the year and hazelnuts fall from 450‰ to 580‰; at 90 days a year, days 29 to 39 and 40 to 51. Fish are caught all year.
- The land's food is day-anchored: a thicket's yearly crop is stated per 365 days and scaled to the year's length, then shared exactly over its window's days at midnight. A berry thicket yields 5,400 kcal a normal year (`berryThicketKcalPerYear`), a hazel thicket 150,000 (`hazelThicketKcalPerYear`); capacity is a good year's crop. Thickets start bare. Wood stays year-anchored.
- Each calendar year draws a poor, normal or good class for berries and for hazel, valley-wide, from the `harvest:<year>` stream (a `harvest` event): berries 500‰, 1,000‰ or 1,400‰ of normal, hazel 300‰, 1,000‰ or 1,600‰.
- At midnight, before the day's crop, berry and hazel places lose 48‰ of their stock to animals and rot (`berryLossPerMille`, `nutLossPerMille`), half in 14 days.
- Expected stock follows the calendar: a seasonal place is expected at the stock last seen if seen since its window began, grown since by a normal crop's daily shares while the window is open; else, while its window is open, the openness share of a normal crop's growth so far; else nothing.
- Each person has a store at their hearth. Nut lots carried home go into it (`stored`); only the owner eats from it (`fromStore`, at `storeKcalPerHour` 6,000, scored like any food source with the walk home); lots spoil in it as carried ones do (`storeSpoiled`). Nuts keep a year (`nutShelfLifeHours` 8,760).
- A store target, `storeKcalPerDay` 2,500 for the reference body for each day to the next berry season, scaled by weight and conscientiousness. A person neither hungry nor short of wood with a store below target gathers a full load of nuts for it at the best expected hazel place, ahead of company, axes, practice and leisure; with no hazel worth working, the lower priorities decide.
- Food to pay for an axe or for wood is gathered, never taken from a store; asking and giving still move only carried food and wood.
- The daily summary records crops, losses, overflow, gathered and eaten food by source, store totals and spoilage; the checker replays crop classes, losses, window growth and store spoiling, and rejects food in a store never put in, taken from another's store or kept past its shelf life.
- The observer is labelled Life 18. The header names the season and, from the first nut day, the year's hazel crop; thickets are drawn by stock, bare outside their windows; a hearth with a store shows a pile of nuts. The person panel has a Store row and a list of the year's crop, the followed person's stores and deaths with their season. The Over time view has Food, People, Craft and Exchange sections; Food has a pie of food eaten by source for this season, this year or the whole run, food eaten by source against energy burned, food on the land, in stores and in bodies, energy reserves with deaths marked by cause, and each year's crop and its fate. The shared charts gain pie, stacked area and stacked bar charts.
- The sun and foliage of update 077 count the year from the founders' arrival, as the calendar does.
- Food choice is faster, with trajectories unchanged. It first scores the store and fishing the nearest known water, a floor no choice falls below. It passes over grid cells of thickets and waters too far to beat that floor, and waters a person would turn down anyway (no better than picking, or no time to go and come home before dusk). It visits the remaining waters nearest first by a heap and stops once none left can beat the best so far. Each person's known waters are kept up to date as banks are learned, and bank searches are cached by position. Days 51 to 60 of the canonical forty take about 0.5 s a simulated day, from 3.3 s.
- Trajectories change: new fingerprints are recorded for all 22 runs. The founders' places, bodies, traits and talents are unchanged from Life 17.
- New unit fixtures for the calendar, crops, losses, year classes, expectation, the store target, storing, eating from and spoiling in the store, eating by source, giving and the checker on seasons and stores.
- `docs/LIFE18_SPEC.md` replaces the Life 17 specification; `stores.ts` is new. Design rule 9 is amended: the land's food is day-anchored. The calibration document gains a Life 18 section.

## [LIFE16-Routes-075] - (2026-10-30)

- Fixes a memory leak on long runs: the state kept every route ever walked, about 45,000 route segments a day, so the heap grew about 12 MB a day and a year's run ran out of memory, in Node and in the page's worker alike. Each step now frees the routes below the lowest one still being walked; route ids keep counting.
Expand Down
38 changes: 38 additions & 0 deletions LAB_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,44 @@ The owner asked to see the seasons in the valley: the sun's path and day length

**Left for later.** People still work from `dawnHour` to `duskHour` all year, so in midsummer they sleep in daylight and in midwinter they work after the drawn sunset. Making them follow the sun changes trajectories and needs its own step.

## [LIFE18-Seasons-076] - (2026-11-03)

The owner moved seasons and stores ahead of the chief and generations, after deferring conflict until the valley knows scarcity, and approved the specification on 2026-11-03. Food on the land now ripens in a season, is lost to animals and rot within weeks, and swings from year to year; people keep a store of nuts at their hearth for the lean months.

**The land's food is day-anchored.** Eating was already anchored to the day, food growth to the year, so at 90 days a year the valley fed four times what it would in life. Crops are now stated per 365 days and scaled to the year's length, and design rule 9 says so. Wood stays year-anchored: the valley's woodland is a small fraction of the real forest, and anchoring it by the day alone would make fuel short for a reason that is not real.

**What implementation changed in the specification.**
- *Expectation.* The first rule expected an unseen thicket at the openness share of its capacity as soon as its window opened. On the first day of the berry season everyone expected full thickets that held one day's crop: the forty-founder fingerprint run started 3,216 walks to forage on day 1, picked almost nothing, built three times Life 17's routes and ran out of memory. A stock seen early in a window was also never expected to grow, so nobody went back to it. Now an unseen thicket is expected at the openness share of what a normal crop has grown so far, and a seen one at what was seen plus a normal crop's daily shares since. Day 1 became mostly fishing, and the heap at day 2 fell to 471 MB, against Life 17's 672.
- *Paying from a store.* A person picking food to buy an axe chose their own store, took a minute's nuts into the hand and put them straight back at the next wake-up: 7,680 one-minute tasks in two days of the lean months. Food to pay for an axe or wood is now gathered, never taken from a store, as giving already was.
- *Store need without hazel.* With no hazel place worth working, the store need does not hold a person; the lower priorities decide.
- *History.* The year's crop is kept in the person panel from the state, not from events, which are kept only three days.

**Speed.** A profile of days 50 and 51 found food choice searching the banks of every known lake and reach on almost every wake-up: in the lean months nothing beats fishing, so no body was ruled out. Bodies are now visited nearest first, and one is skipped when even its nearest corner cannot beat the best choice so far. With that alone, days 51 to 60 of the canonical forty took 3.3 s a day on average, against 267 ms in update 074. The rest of the cost was the same food choice made far more often: in the lean months hungry people fish in short stints and wake again, some 2,300 choices a day.

A second pass, profiled and counted, found where the time went. Each person knows about 3,000 waters through some 35,000 banks. Every choice worked out a bound for each water and sorted them, rebuilt the list of known waters whenever a bank had been learned, and ran a full bank search for about 436 waters a choice, nearly all of them then turned down for a rate no better than picking or no time to return before dusk. The fixes:
- the known waters are kept up to date as banks are learned;
- bank searches are cached by position with numeric keys;
- the store and the nearest water are scored first as a floor;
- thickets are looked at by grid cell and waters by rings of cells, each passed over when even its nearest corner cannot reach the floor;
- waters `consider` would turn down for rate or dusk are passed over before any search;
- the rest are visited by a heap in the same order as before, stopping once even the best rate at the nearest bound left fails.

Every comparison in `consider` is strict with ties to the lower id, and everything passed over scores below the floor or would be refused anyway, so the choice is the same; all 22 fingerprints are unchanged. Days 51 to 60 now take 394 to 541 ms a day, 498 ms on average (timings vary by about a quarter with the machine's load). Food choice is now about a third of the cost; the rest is walking routes, looking around and meetings, as in update 074. That is still almost twice update 074's cost, but inside the browser's second for a day.

**Seasons in the picture.** The sun and foliage of update 077 now count the year from the founders' arrival, as the calendar does, so the run opens in late summer.

**Measured once, canonical forty, seed 20260813, 90-day years, 270 days (three years from arrival) in 12-hour steps.** Calendar years run from the spring equinox: year 1 is the 61 days from arrival, year 4 the 29 lean days before the fourth berry season.
- *Year classes.* Year 1 normal berries and normal hazel; year 2 good and normal; year 3 normal and poor; year 4 good and normal, not yet ripe.
- *Crops and their fate.* Berries: 1.06, 1.49 and 1.06 million kcal in years 1 to 3, of which people gathered 23%, 19% and 26% and animals and rot took 72%, 79% and 77%. Hazel: 29.6, 29.6 and 8.9 million kcal; gathered 20%, 18% and 3%, lost 72%, 82% and 114% (the poor year's losses include nuts left from the year before). No stored nuts spoiled.
- *Eaten by source.* Year 1: berries 3%, fresh nuts 48%, stored nuts 16%, fish 32% of 7.2 million kcal. Year 2: 3%, 34%, 23%, 39% of 8.2 million. Year 3, the poor hazel year: 4%, 3%, 17%, 76% of 7.3 million. Year 4's lean days: all fish.
- *Stores at the end of each nut season.* Nobody reached their target. Year 1: median store 35,092 kcal against a median target of 152,915; the least conscientious third held 28,980 against 116,044 and the most conscientious 38,325 against 196,100; 7 of 40 stores empty, the fullest 60,424. Year 2: median 44,451 against 150,931; thirds 40,243 and 48,454; 4 of 33 empty, the fullest 131,005. Year 3, poor hazel: 27 of 30 empty, the fullest 95,369.
- *Reserves.* The median reserve stayed between 64,000 and 70,000 kcal through the first two years, highest in the nut season, lowest through the lean months. After the poor hazel year it fell to about 35,000 in the lean months, about 4 kg of body fat, and was back to about 48,000 to 54,000 by the next berry season. The lowest reserve fell near zero in every lean season.
- *Deaths.* 14 by day 270, all of hunger: 6 in the lean months after year 1's harvest, 1 in year 2's berry season, 3 after year 2's harvest and 4 after the poor year 3. Days of the year: 75, 81, 2, 12, 12, 26, 31, 82, 89, 22, 67, 81, 85, 13.
- *The living.* 38 at the end of year 1, 31 at the end of year 2, 27 at the end of year 3, 26 at day 270.
- *Asks.* Gifts and refusals by calendar year and season: year 1 berries 29 and 142, nuts 45 and 115, lean 62 and 477; year 2 lean 70 and 302, berries 28 and 59, nuts 15 and 72; year 3 lean 32 and 802, berries 2 and 111, nuts 1 and 197; year 4 lean 2 and 539. Food given fell from 83,293 kcal in year 1's nut season to almost none after the poor year.

**Findings.** Seasons bite: deaths come in the lean months, and a poor hazel year halves the median reserve and moves the valley onto fish. The weight lost in a normal year is small in the median, within the few per cent Jenike (2001) reports for foragers' lean seasons; after the poor year it is larger. Stores fall well short of their targets while most of the hazel crop is lost on the land: gathering trips, not the crop, limit storing, which is a question for the stores' rules (carrying, how long a trip lasts, eating at the thicket) rather than for the land. The conscientious store more, but not in proportion to their targets. Asking rises in the lean months while giving falls, most sharply after the poor year.

## [LIFE16-Routes-075] - (2026-10-30)

While measuring Life 17, a one-year run ran out of memory, and `main` grew at the same rate: running the canonical configuration day by day with `advanceValley` and collecting garbage every 25 days, the heap grew about 12 MB a day, to 2.4 GB by day 150. Node's default heap and the page's worker both fail before a year.
Expand Down
Loading
Loading