code wiki / (root) / nx_tissuebudget.nx

nx_tissuebudget.nx

buildroot/runtime/nx_tissuebudget.nx

8608 B164 linesdepth 4pulls 9 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_tissuebudget.nx -- WHAT THE TISSUE TICK ACTUALLY COSTS, AGAINST THE BUDGET THAT WAS ALREADY BANKED. WHY THIS EXISTS. knowledge/gamefeel_oracle.conf has carried frame_budget_ms_90hz 11..12 and js_block_ms 0..2 since the realism-oracles sweep, both cited to vendor VR performance guidance -- and NOTHING HAS EVER MEASURED OURS AGAINST EITHER. The board says it plainly: a real-time claim with no measured frame cost is a wish. This organ is the measurement, and it REFUSES rather than reporting a number nobody acts on. THE SUBJECT IS THE RUNTIME SPRING, NOT THE XPBD CAGE. sb_tick_mob_gene is what runs every frame for every girl in the browser; nx_softtissue's tet solver runs OFFLINE to identify the plant and never ships in the frame loop. Measuring the cage here would price a cost the visitor never pays, which is the measured-a- different-subject defect. The work unit is therefore ONE CAST TICK: TB_MOBS mobs x SB_PTS spring points. THIS NUMBER IS A FLOOR AND IS LABELLED ONE. It is native x86 on the estate host. The shipped path is WebAssembly in a visitor's browser, which is slower, on hardware that is very likely weaker. A floor is still decisive in one direction: if the FLOOR already misses the budget the browser cannot make it, and that is a refusal you can act on. It can never prove the browser fits, and this file does not claim it. THE SAMPLE SIZE IS DERIVED FROM THE CLOCK, NOT CHOSEN. sys_clock_now_us resolves to 1 us, so a total elapsed of T us carries ~1/T relative error on the per-tick figure. To resolve one part in TB_RESOLVE_PERMIL the run must last at least TB_RESOLVE_PERMIL microseconds, so the loop DOUBLES its tick count until it does. Below that it ABSTAINS instead of dividing a 0 into a per-tick cost of 0 -- the same instrument-resolution trap nx_replyreserve refuses on the reply phase, where "0 ms" meant "under 1 ms". license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_softbind.nx nx_frame_budget.nx nx_oracleband_lib.nx nx_gate_verdict.nx nx_tissuebudget.nx

imports: nx_syscalls.nxnx_softbind.nxnx_frame_budget.nxnx_oracleband_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gv_head gv_puts sys_write ↻ ob_load sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close gv_check gv_puts ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻

structs

none

consts

30const TB_CONF: *u8 = "knowledge/gamefeel_oracle.conf\x00"
31const TB_MOBS: i64 = 16 // the shipped cast: nx_wasm_craft MOB_CAP
32const TB_FPS_VR: i64 = 90 // the rate frame_budget_ms_90hz is cited at
33const TB_RESOLVE_PERMIL: i64 = 1000 // resolve the per-tick figure to one part in this many
34const TB_TICKS0: i64 = 1024 // first attempt; DOUBLED until the run resolves
35const TB_TICKS_CAP: i64 = 4194304 // refuse to spin forever: announced, never silent
36const TB_WARM: i64 = 256 // seat + settle before timing, so page-in is not in the sample
37const TB_MS_US: i64 = 1000
38const TB_GENE0: i64 = 305419896 // one fixed genome; the cost is per-point and genome-independent,

functions

42func tb_one_tick(st: *i64, t: i64) -> i64
called by 1: tb_run calls 1: sb_tick_mob_gene
52func tb_run(ticks: i64) -> i64
67func tb_measure(out: *i64) -> i64
called by 1: main calls 1: tb_run
81func tb_ns_per_tick(elapsed_us: i64, ticks: i64) -> i64 { return elapsed_us*1000/ticks }
called by 1: main
83func main() -> i64