Coverage: routines executed by the interpreter per route, and the porting order it gives #30
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Brief §7.1 step 5 and §8.3 ("coverage drives route writing"): interpreter entries are counted per movie; the goal is zero.
ff6cli --coverage <file>and a drive-server command.tools/coverage_report.py: aggregate the coverage of all movies (US and JP), resolve routines withtools/ff6sym.py(module, file, name), report per module (field, event, menu, battle, btlgfx, world, cutscene, sound): routines reached / total, instructions executed; list never-executed routines (input for new routes).FieldMain), weighted by calls x instructions and by the subsystem plan of the brief; written todocs/coverage.md(method) and posted here (numbers).Starting: branch
coverage, delegated to a fresh agent (background).Coverage of the three committed routes (PR #31), US v1.0 and JP v1.0, from
ff6cli --movie ... --coverageandtools/coverage_report.py(method indocs/coverage.md, full reports with never-executed routines inre/coverage/route_library.*.md).Measured (route library, US v1.0 and JP v1.0)
Coverage files of the committed movies (
--movie ... --coverage, release build), from power-on;every replay still matches its end hashes. Reports:
re/coverage/route_library.<version>.md(
coverage_report.py <3 files> --never --field-order 40); the coverage files themselves stayoutside the repository.
narshe_to_world_mapreplaystitle_to_first_battle_winfirst, so theaggregated instruction counts include that route twice (routines reached are unaffected).
title_to_first_battle_winfield_menu_tournarshe_to_world_mapPer module, all three routes:
$1500/$1504)Shares are dominated by busy waits:
WaitVblankalone is 491 M of the field's 757 M (US), thebattle graphics
WaitVblank($C1:1A24) 208 M of btlgfx's 550 M. No shadow stack overflow, nothing dropped.Proposed field porting order
Top 15 of
--field-order(US; JP gives the same routines,DrawLetterat 15 andDecTimersMenuBattleat 11, addresses shifted after$C0:7xxx):C0:3A28C0:677BC0:5839C0:573CC0:714AC0:42B6C0:CC95C0:2BD0C0:BBF1C0:1053C0:88D3C0:903FC0:BB24C0:249AC0:6721All are leaves (no field callee;
MoveObjscallsUpdateObjFrame, ported just before) thatreturn within the frame. Reading of the full order (374 routines US, 372 JP):
of the
FieldMainloop andFieldNMI/FieldIRQ, then the text renderer; each runs ~50 000times on the routes, so shadow validation gets many calls quickly.
LoadMapPal,InitNPCMap,InitBG*VScroll...) and the event commandsthat do not wait, interleaved by weight; the callers (
DrawObjSprites71.7 M,UpdateObjActions,FieldNMIwith its 20 callees) follow their callees.WaitVblank, the map loaders that run forseveral frames with the screen off (
Decompress,LoadMapTiles,InitMapTiles,InitObjGfx,LoadMap), the event commands that wait (EventCmd_f0fades, titleEventCmd_a9/aa/ab),ExecBattle,OpenMenu, then the interpreter loop (ExecEvent,ContinueEvent) andReset/FieldMain. "Crosses frames" means either a wait or more than oneframe of CPU time; both need the frame model (§5.1) before they can run as C in mode
on.This order is by measured weight; the subsystem plan (reuse audit: boot and map load first) reads
off the Role column: boot and map-load leaves are early enough to start with, but their callers
(
LoadMap) cross frames and come last.Merged (PR #31). Main-session check: release
--fast24/24 incl.rom.coverage.*(identical coverage across runs and between ff6cli and the drive server, hashes unchanged). Next: a field porting milestone driven by the order above.