Files
nxnative-easy/docs
seedds 830ecde2a7 Breath of the Wild's world-load crash: our command records were larger than the driver's; plain draws are compact and recordings have no BEGIN
About 1 run in 3 crashed about 3 s after Start (operator new at main+0x155a79c
returned null, written through at main+0x155a7a4). Each model file gets a heap
of its resource size table entry + 0x1008; the file goes in 4 KB aligned and
the model's setup (main+0x155a2ac) takes the rest as a frame heap. Part of the
setup is GPU memory for the model's prerecorded commands, which the game sizes
by recording each mesh's draw and each shape's state for each render pass into
a scratch command buffer and summing nvnCommandBufferGetCommandMemoryUsed. So
our record sizes count against the table: draw records had grown to carry the
indirect and multi-draw fields (0x38 -> 0x50 per recorded draw on 10-18 and
10-20), and every recording began with an 8-byte BEGIN record. Of the 497
models of the world load, Obj_TreeConiferous, Obj_TreeBroadleaf_B and
FldObj_HyliaBridge_A-02 needed one 4 KB page more than their entries allow,
which fit only when the file's alignment pad was small (about 15% of loads each
failed); the others had about 0xd00 to spare for any pad.

- Plain draws leave out the indirect / multi-draw fields (hle_nvn.c rec_draw);
  the replay reads draw records through draw_rec / draw_idx_rec (nvn_obj.h).
- A recording starts with its first command, as in NVN: no BEGIN record, the
  handle is the first record, an empty recording takes only its END.
- 0x30 per recorded draw now; all 510 models of the world load fit whatever
  the pad (probe check in docs/agents/03-bringup.md). World-load A/B on the Mac:
  main 2 crashes of 8 runs, this 0 of 8. Super Mario Bros. Wonder (opening
  course), Age of Calamity (first battle), Monster Hunter Rise and Three Houses
  boots behave as on main. t_nvn 74/74 (6 new checks on recording sizes).
- DM_PROBE heap walk: layouts of other sead versions (DM_PROBE_HEAP), frame
  heaps (DM_PROBE_HEAPFRAME), a heap-name filter (DM_PROBE_HEAPNAME), block
  contents (DM_PROBE_HEAPWORDS), the raw heap object (DM_PROBE_HEAPRAW); each
  hit prints as one block.

Mario's +16 KB resource-heap cut (a model 0x70 bytes short) may have the same
cause; not checked, so the cut stays.
2026-10-21 13:04:04 +08:00
..