code wiki / _hdl_build / nx_author.nx
nx_author.nx
buildroot/runtime/_hdl_build/nx_author.nx
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
imports: nx_engineer_crash.nxnx_superopt_emit.nx
imported by: nx_author_test.nx
structs
| none |
consts
| 13 | const AU_MAGIC_1024: i64 = 1024 |
| 15 | const AU_MUL: i64 = 0 |
| 16 | const AU_ADD: i64 = 1 |
| 17 | const AU_SUB: i64 = 2 |
| 18 | const AU_XOR: i64 = 3 |
| 19 | const AU_AND: i64 = 4 |
| 20 | const AU_OR: i64 = 5 |
| 21 | const AU_SHL: i64 = 6 |
| 22 | const AU_NONE: i64 = 0 - 1 |
functions
| 24 | func au_name(op: i64) -> *u8 called by 1: at_main |
| 37 | func au_emit_probe(mnem: *u8, K: i64, x: i64, buf: *u8) -> i64 |
| 48 | func au_observe(mnem: *u8, K: i64, x: i64) -> i64 |
| 59 | func au_predict(op: i64, x: i64, K: i64) -> i64 called by 1: au_learn |
| 72 | func au_learn(mnem: *u8, Ks: *i64, Xs: *i64, n: i64, obs: *i64) -> i64 |