code wiki / (root) / nx_paced_fetch_gate.nx

nx_paced_fetch_gate.nx

buildroot/runtime/nx_paced_fetch_gate.nx

6957 B118 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_paced_fetch_gate.nx -- GATE for nx_paced_fetch (the capture path's ONE pacing hook, /compare/mediaingest R0). No network: both fixture hosts live under the reserved .invalid TLD and nothing is ever fetched. Every decision under test is nx_crawl_pace's own arithmetic (its policy has its own gate); this gate proves the HOOK's composition around it -- host extraction, the wait actually served on the clock, the burst form's discriminator, the decay, and that a throttle on one host never touches another. The pace table is PERSISTENT and shared with production, so both fixture hosts are reset at setup and teardown (the same self-isolation nx_crawl_pace_gate established on 2026-08-02). license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_crawl_pace.nx nx_paced_fetch.nx nx_gate_verdict.nx nx_paced_fetch_gate.nx

imports: nx_syscalls.nxnx_crawl_pace.nxnx_paced_fetch.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_head gv_puts sys_write 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 ↻ sys_mmap ↻ pf_host_of gv_check gv_puts ↻ pf_before pf_host sys_mmap ↻ pf_host_of ↻ pace_before_tbl pace_hash pace_slot pace_ld pace_ld ↻ pace_wait_ms sys_now_realtime_ms sys_mmap ↻ sys_clock_gettime_real sys_sleep_ms sys_mmap ↻ sys_munmap

structs

none

consts

13const G_URL_A: *u8 = "https://pf-fixture-a.invalid/seg/001.ts?tok=1"
14const G_URL_B: *u8 = "https://pf-fixture-b.invalid/x"
15const G_URL_HOSTPORT: *u8 = "https://cdn.example.invalid:8443/a/b?x=1#f"
16const G_URL_TINY: *u8 = "http://h/p"
17const G_URL_NOSCHEME: *u8 = "no-scheme-here/path"
18const G_HOST_LEN_CDN: i64 = 19 // strlen("cdn.example.invalid") -- the port and path must NOT be part of the host
19const G_HOST_LEN_TINY: i64 = 1
20const G_RA_S: i64 = 2 // the planted Retry-After: short enough to sleep through in a gate, long enough that a wait of 0 cannot pass by accident
21const G_MS: i64 = 1000
22const G_HTTP_429: i64 = 429
23const G_HTTP_200: i64 = 200
24const G_CLOCK_TOLERANCE_PERMIL: i64 = 900 // the sleep must serve at least 900 permil of the wait it reported (scheduler jitter on a loaded box, never a shortfall by design)
25const G_PERMIL: i64 = 1000
26const G_HOST_CAP: i64 = 512
27const G_SLOTS: i64 = 4096 // PACE_SLOTS -- the open-addressed pace table's fixed slot count (nx_crawl_pace)
28const G_REC: i64 = 40 // PACE_REC -- one pace record's byte width; hash is its first 8 bytes

functions

30func main() -> i64