code wiki / _hdl_build / nx_author.nx

nx_author.nx

buildroot/runtime/_hdl_build/nx_author.nx

3816 B84 linesdepth 4pulls 5 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_author.nx -- the team AUTHORS a new technique from its own diagnosis, by EXPERIMENT. Last loops the team diagnosed "the competitor used a mnemonic I lack: imul" and I had to tell it (or pre-stock) what imul does. This removes me: the team LEARNS the instruction's semantics itself. It emits the instruction (in the form it observed in the competitor's objdump: `imulq $K, %rdi, %rax`), RUNS it on several (K,x) probes, observes the outputs, and INFERS which operation it computes by testing hypotheses {mul,add,sub,xor,and,or,shl} against the observed input->output pairs. The hypothesis that matches ALL probes is the learned semantics. Discovery by experiment -- the team teaches ITSELF a new primitive. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_engineer_crash.nx nx_superopt_emit.nx nx_author.nx nx_author_test.nx

imports: nx_engineer_crash.nxnx_superopt_emit.nx

imported by: nx_author_test.nx

structs

none

consts

13const AU_MAGIC_1024: i64 = 1024
15const AU_MUL: i64 = 0
16const AU_ADD: i64 = 1
17const AU_SUB: i64 = 2
18const AU_XOR: i64 = 3
19const AU_AND: i64 = 4
20const AU_OR: i64 = 5
21const AU_SHL: i64 = 6
22const AU_NONE: i64 = 0 - 1

functions

24func au_name(op: i64) -> *u8
called by 1: at_main
37func au_emit_probe(mnem: *u8, K: i64, x: i64, buf: *u8) -> i64
called by 1: au_observe calls 2: se_strse_num
48func au_observe(mnem: *u8, K: i64, x: i64) -> i64
59func au_predict(op: i64, x: i64, K: i64) -> i64
called by 1: au_learn
72func au_learn(mnem: *u8, Ks: *i64, Xs: *i64, n: i64, obs: *i64) -> i64
called by 1: at_main calls 2: au_observeau_predict