Skip to content

Fire solver: items 12, 14, 16 to 19 and 13, all off by default - #29

Merged
libishm1 merged 6 commits into
mainfrom
flamescapes/phase0-items
Nov 29, 2026
Merged

libishm1 merged 6 commits into
mainfrom
flamescapes/phase0-items

Conversation

@libishm1

Copy link
Copy Markdown
Owner

Six fire-solver items from the calibration plan, one commit each, every switch off by default:

  • 12 and 14, burner flame rays and flame radiant once
  • 16, source expansion
  • 17, porous exchange in conduction
  • 18, burn-out heat to the cell's gas
  • 19, porous drag as a rate
  • 13, timber linings, CPU only; the GPU refuses timber scenes

Each item has a unit test in src/core.

Checks against main 58657bd:

  • npm test 599/600; the one failure is the known wall-clock test, which passes alone (9/9, three times) and in a full run at 3 workers (600/600).
  • Lint and build pass; fingerprints unchanged (d62b581d, 29793d1a).
  • With every switch off, the identity and validation digests are the same as main's, and the GPU check matches main in all 4696 deterministic leaves.
  • Each item's check tool passes, apart from failures that come from the tools' old bases or test counts.

The GPU heptane spill with no suppression sometimes stays at about 25.5 MJ with a 496 kW peak. Main does the same: in runs alternated with main, 4 of 6 main runs and 3 of 6 runs at item 16 stayed low. It is not caused by this branch; the CPU result (30.04 MJ) is the same on both.

Item 12 (plan 16.10, 16.12, 16.13): with burnerFlameRays 1 a validation
burner's radiant part leaves from the cells where its fuel burnt, drawn
by their kg, and is marched by burnerMarch (march is unchanged). Item 14
(plan 16.14, 16.15, 16.21): with flameRadiantOnce 1 the cells where a
burner with a radiant fraction burnt are silent in the radiation stage;
what they would have emitted goes to stats.flameSilenced. The GPU's
supported() sends such a burner to the CPU when item 14 is on.

Both switches default to 0, and with both at 0 every output is as
before. The run cache keys either switch only when a run sets it, so
RUN_CACHE_VERSION stays 13. The validation suite takes
--burner-flame-rays and --flame-radiant-once. The check tools are
tools/burner-rays-check.mjs and tools/flame-radiant-once-check.mjs.

Source: flamescapes/burner-rays at 385dbec, squashed; its plan commits
under wiki/ are left out. Rebuilt on origin/main 58657bd; it applied
without a conflict. Added: a unit test,
src/core/flamescapes.flameRays.test.mjs (off equals the default bit for
bit; item 12's shares in a cube and its energy per step; item 14's
silence against the item off's emission).

Checks at this commit: npm test 574 of 575 (572 on origin/main plus
the 3 new); the one failure is the 100 ms wall-clock test "200 heads
and 1000 obstructions", which imports no file this branch changes and
passes alone 9 of 9 three times. The fingerprint tool (300 steps)
d62b581d and 29793d1a, as origin/main.

Check tools on the branch's final tree (all six items, every switch
off): tools/burner-rays-check.mjs 115 PASS, 1 FAIL, 58 reported;
tools/flame-radiant-once-check.mjs 280 PASS, 2 FAIL, 44 reported. The
three FAILs are the off-is-off parts (i) and (g) against the tools' old
bases 40f8ea9 and 1dd890a, and each names only sim.sourceExpand, the
property item 16 adds and sets to null when it is off. (i) passes as
written against 61bd1f9, which has that property (4 PASS, 0 FAIL);
with that one key exempted, (i) and (g) pass against their own bases
(4 and 8 PASS, 0 FAIL).
Item 16 (plan 16.19, 16.20, 16.24, 16.25, 16.28, 16.36): with
sourceExpansion 1 and the expansion on, the gas a source adds pushes out
the gas it displaces. Every change a source makes to a gas cell's moles
(changeGas: the burner, the contents, gas-phase combustion, the spray,
soot deposition) adds ln(1 + dn/n) to the cell's expansion (moleChange,
expansionEnd), on the CPU and on the GPU (kernels.js changeGas into the
D field). The tallies sourceMoles, sourceVolume and sourceShortfall are
kept only with the item on.

The switch defaults to 0, and with it at 0 every output is as before.
The run cache keys it only when a run sets it, so RUN_CACHE_VERSION
stays 13. The validation suite takes --source-expansion, and
heat-closure.mjs takes the switch through --solver.

Source: flamescapes/source-expansion-2 at 61bd1f9, squashed; its plan
commits under wiki/ are left out. Conflicts with items 12 and 14
(validation-suite.mjs, flamescapes.js, runCache.js) are resolved as
flamescapes/phase0-r0 (ebbfa43) resolved them, keeping both sides; the
one change from ebbfa43 is RUN_CACHE_VERSION, kept at 13 (ebbfa43 raised
it to 14 only so that branch builds' kept runs were not mixed). The
check tools are tools/source-expansion-check.mjs and
tools/source-expansion-diagnose.mjs. Rebuilt on origin/main 58657bd; it
applied without a conflict.

Added: a unit test, src/core/flamescapes.sourceExpansion.test.mjs (off
equals the default bit for bit; check (b)'s open box: D dt against
ln(1 + x) and the opening's flow against the sources' volume flow). The
test's later fixup (a faster case) is folded in here.

Checks at this commit: npm test 577 of 577 pass; the fingerprint tool
(300 steps) d62b581d and 29793d1a, as origin/main.

Check tool on the branch's final tree (every switch off):
tools/source-expansion-check.mjs, parts a, b, c, d, f and h on the CPU
72 PASS, 0 FAIL, 52 reported; parts e and f on the GPU in headless
Chrome (Intel gen-12lp) 537 PASS, 0 FAIL, 197 reported.
Item 17 (plan 16.26, 16.27, 16.37): with porousExchange 1, every
exchange of the conduction stage that touches a porous cell whose solid
holds heat (its own gas, its gas faces, its pairs with a porous or
lumped solid of capacity above 0; no one-dimensional wall) is solved
from the stage's starting temperatures, each body taking the share
G / S of its capacity; the rest of the stage runs as before and skips
them. On the CPU (conduct, porousTogether) and on the GPU (kernels.js
conductShares and conductTogether, which use the cf buffer's vorticity
scratch; the face passes skip the porous exchanges). Exports for the
check tool that no run calls: conductionStage, STAGES and the GPU hook
conductionPass.

The switch defaults to 0, and with it at 0 every output is as before.
The run cache keys it only when a run sets it, so RUN_CACHE_VERSION
stays 13. The check tool is tools/porous-exchange-check.mjs.

Source: flamescapes/porous-exchange at 0ae1454, squashed; its plan
commits under wiki/ are left out. Conflicts with items 12, 14 and 16 in
flamescapes.js (DEFAULTS), flamescapesGpu.js (the uniforms),
flamescapesGpu/kernels.js (PARAMS, from which the WGSL struct is
generated by name) and runCache.js (KEYED_SWITCHES) are resolved by
keeping both sides; the items write different GPU fields (item 16 the
D field, item 17 the vorticity scratch). Rebuilt on origin/main
58657bd; it applied without a conflict.

Added: a unit test, src/core/flamescapes.porousExchange.test.mjs (off
equals the default bit for bit; check (a)2 and (a)4 in the burnt-out
scene: a nearly burnt-out cell ends one conduction stage at T* within
16.26's bound, and within its partners' range; off it ends 61 K away).

Checks at this commit: npm test 578 of 579; the one failure is the
100 ms wall-clock test "200 heads and 1000 obstructions", which passes
alone 9 of 9 three times. The fingerprint tool (300 steps) d62b581d
and 29793d1a, as origin/main.

Check tool on the branch's final tree (every switch off):
tools/porous-exchange-check.mjs. Parts s and e2 on the GPU: 799 PASS,
0 FAIL, 338 reported. Parts e3 and fg: 33 PASS, 0 FAIL, 7 reported;
fg compares tools/flamescapes-gpu-check.mjs (all phases) with two runs
of origin/main: 4696 deterministic leaves judged bit for bit, 0
differ; the GPU runScene results of seven runs (sprinklers, design,
systems) vary between origin/main's own two runs and are reported, not
judged. Parts f and h: 4 PASS, 0 FAIL, 4 reported. Parts fu and g:
2 FAIL by the tool's rules, neither a fault of the item: fu asks the
unit suite's count to equal its old base's (600 of 600 pass here,
against 537 of 537 at 0333e0e; the branch adds tests), and g sets the
default to 1, where 598 of 600 pass: the two that fail are this item's
own unit tests, which assert the default is 0 and take the default as
off.
Item 18 (plan 16.33, 16.34, 16.38, 16.40, 16.41, 16.48): with
burnoutHeat 1, on the CPU and the GPU, a chemistry call whose reactions
leave a porous cell with no inert mass at most 1e-7 kg of fuel writes
their heat into the cell's own gas, not into a solid that vanishes in
the same call (before, T_s reached 1e8 to 5e9 K in a cell that then
turned gas); a cell that turns gas takes T_s = ambient; and a flame
front particle or an ember takes a cell's T_s only where the cell is
not gas and its solid holds heat (spawnSolidT). The CPU tallies
stats.burnoutHeat and stats.burnouts with the item on.

The switch defaults to 0, and with it at 0 every output is as before.
The run cache keys it only when a run sets it, so RUN_CACHE_VERSION
stays 13. The validation suite takes --burnout-heat. The check tool is
tools/burnout-heat-check.mjs; the GPU hook chemistryPass is for it.

Source: flamescapes/burnout-heat at 089296e, squashed; its plan commits
under wiki/ are left out. Conflicts, each resolved by keeping both
sides: flamescapes.js (header, DEFAULTS, and the stats object, which
takes each item's tallies under its own condition), flamescapesGpu.js
and kernels.js (the uniforms), runCache.js (KEYED_SWITCHES) and
validation-suite.mjs (the header, the four flags, their options, ledger
tallies and settings; one import of the solver for the flag checks).
Not a textual conflict: item 18's export list named chemistryStage and
STAGES, which items 16 and 17 already export, so it now exports
solidCapacity alone (a duplicate export does not load). Rebuilt on
origin/main 58657bd; it applied without a conflict.

Added: a unit test, src/core/flamescapes.burnoutHeat.test.mjs (off
equals the default bit for bit; check (a)'s isolated cell: at 1e-6 and
2.93e-4 kg the gas takes Q_b within 2 float32 steps, T_s is ambient
and stats.burnoutHeat is Q_b, while off T_s passes 1e6 K; at 1e-2 kg
the switch changes nothing).

Checks at this commit: npm test 582 of 582 pass; the fingerprint tool
(300 steps) d62b581d and 29793d1a, as origin/main.

Check tool on the branch's final tree (every switch off):
tools/burnout-heat-check.mjs, parts a, b1 and b2 on the CPU 80 PASS,
0 FAIL, 33 reported; parts c1, c2 and c3 on the GPU 119 PASS, 0 FAIL,
97 reported.
Item 19 (plan 16.31, 16.32, 16.35, 16.46): with porousRate 1, each face
of the projection that touches a porous cell integrates
du/dt = F - beta_n u over the step, beta_n = n ln(1/m) / 0.1 s, so a
porous cell slows the flow at a rate per unit time, not by a factor each
step. Faces beside no porous cell are as before, number for number. On
the CPU (porousRateTable, porousFace, projectStage) and on the GPU (the
PARAMS porousRate and four factors set by the host each step; the
porous kernels in the projection).

The switch defaults to 0, and with it at 0 every path computes as
before. Added here: runCache.js keys porousRate when a run sets it, as
it keys items 12 to 18 (the source branch did not), so a run made with
the item is never played for one without; RUN_CACHE_VERSION stays 13.
The check tool is tools/porous-rate-check.mjs, and the diagnosis tool
tools/step-convergence-diag.mjs.

Source: flamescapes/step-convergence at c7f748b, squashed; its plan
commits under wiki/ are left out. Conflicts, each resolved by keeping
both sides: flamescapes.js (item 17's conductionStage and exported
STAGES beside item 19's projectStage), flamescapesGpu.js and kernels.js
(the uniforms). The merged changes of the three solver files equal the
source branch's own, line for line.

Rebuilt on origin/main 58657bd: one conflict, in flamescapesGpu.js's
imports, where main (PR 27) imports detectorChambers from tenability.js
and this item adds porousRateTable to the import from flamescapes.js
and its helper porousRateParams below it. Both are kept; the file is
the item's own plus main's change, line for line.

Added: a unit test, src/core/flamescapes.porousRate.test.mjs (off
equals the default bit for bit; check (a)1, porousFace against its
closed form; check (a)2, a circulation in the porous box decays as
exp(-beta2 t) at 0.1 and 0.05 s steps, while off the two steps differ).

Checks at this commit: npm test 585 of 585 pass; the fingerprint tool
(300 steps) d62b581d and 29793d1a, as origin/main.

Check tool on the branch's final tree (every switch off):
tools/porous-rate-check.mjs, part a on the CPU 27 PASS, 0 FAIL,
1 reported; part c on the GPU 56 PASS, 0 FAIL.
Item 13 (plan 16.11, 16.12, 16.23, 17.6): with timberLinings 1, a
one-dimensional wall's timber layer facing gas heats, reaches its
ignition temperature, and burns from a char front at that isotherm,
its vapour entering the gas as a fuel of its own kind (timberSetup,
timberFaces, timberVapour; TIMBER_SOUTHERN_PINE, timberLayer). The CPU
tallies timberPyrolysed, timberOut, timberEndotherm, timberReleased and
timberFaces only when a timber face exists.

CPU only. Plan 16.11 point 13 (and 16.23's open point 1) asks that the
GPU refuse a timber scene before the switch is ever offered; the source
branch did not build that. Added here: flamescapesGpu.js supported()
returns false when sim.wall.timber is set, which happens only with the
item on and a timber face present, so runScene falls back to the CPU
(or throws "The GPU solver does not cover this scene." when the app's
worker asks for no fallback, and the worker then runs the CPU). With
the item off the GPU takes the same scenes as before. supported() is
now exported for the unit test; the check tools still read its source.
No user-facing control sets the switch (16.12, decision 7).

The switch defaults to 0, and with it at 0 every output is as before.
The run cache keys it only when a run sets it, so RUN_CACHE_VERSION
stays 13. The check tool is tools/timber-lining-check.mjs.

Also from the branch, the materials-study tooling of study/materials
(8442efd): tools/studies/ (materials-study.mjs, lib/furniture.mjs,
lib/layer.mjs, lib/linings.mjs, parametric_family.py and
variants.example.json), tools/ifc-extract.mjs (a material per element),
flamescapesRun.js (its options for the study, unset by default),
heat-closure.mjs's timber case, and src/core/studyTools.test.mjs.

Source: flamescapes/timber-linings at 6dfdca1, squashed; its plan
commits under wiki/ are left out. Conflicts, each resolved by keeping
both sides: flamescapes.js (header, DEFAULTS, the stats object) and
runCache.js (KEYED_SWITCHES). Not a textual conflict: items 13 and 16
each exported chemistryStage = chemistry; one export remains.

Rebuilt on origin/main 58657bd: two conflicts in flamescapesRun.js,
both kept on both sides. The imports: main's detectorChambers import
beside this item's MATERIALS in the voxelize.js import. runScene: main's
detectorEntryLag option and its doc lines beside this item's inspect
option and its doc lines; the signature takes both, each off by default.
The file is the item's own plus main's change, but for that one line.

Added: a unit test, src/core/flamescapes.timber.test.mjs (off equals
the default bit for bit; check (b)1: 18 mm pine under 30 kW/m^2
ignites within 5 % + dt of the closed-form time and its vapour enters
the gas, off nothing pyrolyses; the GPU's supported() false with the
item on and a timber face, true off or without timber).

Checks at this commit, the branch's tip, against origin/main 58657bd:
npm test 599 of 600 (572 on origin/main plus the six items' 28); the
one failure is the 100 ms wall-clock test "200 heads and 1000
obstructions", which imports no file this branch changes, passes alone
9 of 9 three times, and passed in a whole run of 600 of 600 at 3
workers. npm run lint exit 0; npm run build exit 0, with origin/main's
chunk-size warning. The fingerprint tool (300 steps) d62b581d and
29793d1a, as origin/main.

Every switch off, the same output as origin/main: runScene and the bare
solver on the fingerprint tool's room with the class A design fire,
240 s, embers off and on, give frames 5b580903bb226e07 and
283a8bf3c0dcee04, stats cd1a8f81c2a1ac62 and 9562c4c694d7cd26 (the
same 18 keys) and state 93dc97638e3ee8d6 on both; the validation suite
on fsri/100kWSB_Open_Back_1 and atf/050 at 0.34 m, capped at 180 s and
full, gives readings 2884ad3c476078fa, 1fdd8dc78974e7a9,
e93fa3a8db4893bf and 34c02452609ffdfa on both, with every other
recorded part (ledger, trees, grid, burner, settings) the same.

On the GPU (headless Chrome, Intel gen-12lp), with every switch off,
tools/flamescapes-gpu-check.mjs (all phases) matches two runs of
origin/main in all 4696 deterministic leaves. Its GPU runScene results
vary from run to run on origin/main as well, and are reported, not
judged. One is left open: the systems phase's heptane spill with no
system stayed at about 25.5 MJ with a 496 kW peak in 4 of 8 runs here
and in none of 9 on origin/main; the other runs overlap (29.7 to 44.3
MJ on origin/main, 29.8 to 36.8 MJ here), and the CPU's result, 30.04
MJ, is the same on both.

Check tool: tools/timber-lining-check.mjs 42 PASS, 2 FAIL, 29
reported, 1 departure. The two FAILs are (g)'s off-is-off lines
against the tool's old base 8442efd and name only sim.sourceExpand
(item 16's property, null when off). Against f3a0f6c, the branch
without this item, (g) passes as written (4 PASS, 0 FAIL); with that
one key exempted it passes against 8442efd too (4 PASS, 0 FAIL). The
departure line is the tool's fixed text; its figures are what 16.11
point 13 asks: supported() false with the item on and 32 timber faces,
true with it off.
@libishm1
libishm1 merged commit 31a2ad7 into main Nov 29, 2026
1 check passed
@libishm1
libishm1 deleted the flamescapes/phase0-items branch November 29, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant