code wiki / _hdl_build / nx_auction_timed.nx
nx_auction_timed.nx
buildroot/runtime/_hdl_build/nx_auction_timed.nx
about
nx_auction_timed.nx -- MANHEIM-BUILD-L1: the TIMED WHOLESALE-AUCTION ENGINE, the defining
marketplace primitive of a vehicle remarketing exchange (Manheim Timed Sales / OVE). Sovereign
(nx_cc->nxasm, no gcc), pure integer-exact + deterministic -- the EXCEED axis vs opaque proprietary
auction engines: every bid's accept/reject and the final settlement are a REPRODUCIBLE verdict
(auditable), and the anti-snipe end-extension is a DETERMINISTIC fairness rule, not a human gavel.
MODEL (all money in integer cents, all time in integer ticks):
listing = {opening, increment, reserve, start, end, snipe_window, extension}
bids = parallel arrays bidder[]/amount[]/time[], GIVEN IN TIME ORDER (the run-list is ordered).
rules (at_resolve):
* a bid is VALID iff start <= t <= effective_end AND amount >= required-min, where
required-min = (no high bid yet ? opening : high + increment).
* an accepted bid sets the new high (amount, bidder).
* ANTI-SNIPE: an accepted bid landing within snipe_window of the close EXTENDS the close to
t + extension (gives other dealers a fair chance -- kills last-tick sniping deterministically).
* at close: SOLD to the high bidder iff high >= reserve, else NO-SALE (reserve not met).
outputs via out[6]: [winner_bidder, winning_price, status(1=SOLD/0=NOSALE), final_end, accepted, rejected]
main() is the SELF-VALIDATING GATE: two hand-computed scenarios with TIGHT expected values --
(A) a sale where a 195-tick bid extends the 200-tick close to 225, letting a 215-tick bid win
(proves anti-snipe: WITHOUT extension that bid is after-close and a different bidder wins);
(B) a no-sale where the top bid is below reserve.
Plus reject controls (below-increment + after-close bids MUST be rejected). A broken rule diverges
a checked value -> verdict=RED. Evidence -> knowledge/status/auction_timed.log. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_auction_core.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 27 | const AT_MAGIC_900000: i64 = 900000 |
| 28 | const AT_MAGIC_925000: i64 = 925000 |
| 29 | const AT_MAGIC_930000: i64 = 930000 |
| 30 | const AT_MAGIC_950000: i64 = 950000 |
| 31 | const AT_MAGIC_1000000: i64 = 1000000 |
| 32 | const AT_MAGIC_1025000: i64 = 1025000 |
| 33 | const AT_MAGIC_1030000: i64 = 1030000 |
| 34 | const AT_MAGIC_25000: i64 = 25000 |
| 36 | const AT_LOG: *u8 = "knowledge/status/auction_timed.log" |
functions
| 38 | func at_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 39 | func at_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 43 | func main() -> i64 |