code wiki / (root) / nx_etg_tournament.nx

nx_etg_tournament.nx

buildroot/runtime/nx_etg_tournament.nx

5330 B136 linesdepth 4pulls 4 transitivereach 1 importersview sourcekind librarytopic etg
docsdependenciesstructsconstsfunctions

about

nx_etg_tournament.nx -- multivariate tournament selector. E2 first stone of NISHI_ETG_ROADMAP.md. Implements the selection logic that consumes pre-computed variant results (correctness + perf_metric per variant) and picks the empirical winner. Composes E1 nx_etg.nx attestation primitive to emit a ProvenanceLinked decision record per selection. This brick is the SELECTION LAYER. The DISPATCH layer (actually running N kernel variants on calibration corpus + measuring their outcomes) is E2.5; first real per-tier probes (E3+) wire dispatch + selection + attestation into per-probe pipelines. Why pre-computed results: separates correctness/perf measurement (which differs per probe family, per silicon) from the SELECTION algorithm (which is universal: correctness gate + argmin perf + deterministic tie-break + no-winner detection). The selection logic ships now + KAT-verified; dispatch lands per-probe. Composes: [[NISHI_ETG_ROADMAP]] E2 (this is the first stone) nx_etg.nx (NxEtgEntry attestation; E1 SHIPPED) [[feedback-no-false-ok-substrate-honesty-audit]] (no-winner returns NX_ETG_TVAL_NO_WINNER deterministically; never silently picks a failed variant) [[NISHI_SELF_ASSEMBLY_ROADMAP]] Section 2.1 Petabricks choice-grammar (the variant manifest shape this implements) Cardinal 13 (tournament selections are ProvenanceLinked + tombstone on re-selection; never overwrite prior decisions) API: nx_etg_tournament_select(variant_ids, correctness, perf_metric, n) -> i64 Returns winning variant_id (>= 0) or NX_ETG_TVAL_NO_WINNER. nx_etg_tournament_attest(entry, silicon_serial, variants_tested, winning_variant, probe_kind, selector_version, timestamp_q14) -> i64 Emits an NxEtgEntry recording the selection. Composes nx_etg_entry_init with outcome = RECLAIMED (the substrate selected the empirical winner over any vendor-marketed default).

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_etg.nx nx_etg_tournament.nx nx_etg_tournament_test.nx

imports: nx_syscalls.nxnx_etg.nx

imported by: nx_etg_tournament_test.nx

structs

none

consts

63const NX_ETG_TVAL_NO_WINNER: i64 = -1
64const NX_ETG_TVAL_PASS: i64 = 1
65const NX_ETG_TVAL_FAIL: i64 = 0

functions

78func nx_etg_tournament_select(
called by 1: main
116func nx_etg_tournament_attest(
called by 1: main calls 1: nx_etg_entry_init