upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/active_input_test.cpp
diff options
context:
space:
mode:
authorbobcatchris <83428450+bobcatchris@users.noreply.github.com>2026-11-30 12:00:55 -0600
committerbobcatchris <83428450+bobcatchris@users.noreply.github.com>2026-11-30 12:00:55 -0600
commit6bbaeed111a656c5b4ee54fe9c113a61b185e7c6 (patch)
treef34dbfbe41aa1bfb69e50f30552f9dcac00e6fff /runtime/test/active_input_test.cpp
parent08e42a516097e5a645c5728a88177c7d08d9093e (diff)
D3D12-SHADER-ITE-LOSSY-MEMO: keep the results of Bools::ite in a table that forgets (-12 % of full-archive translate time)
`Bools::ite` kept every result in a hash map. A result depends on its triple alone, and the nodes made on the way to it stay in the diagram, so a result that is asked for again after it was dropped finds those nodes and makes none: the table can forget without the diagram changing. It is now a set-associative table of four 16-byte entries to a cache line (the newest of a set first), which doubles, keeping what it holds, while the diagram has more nodes than it has entries. A lookup touches one line, and nothing is rehashed as the table grows. `Bools::mk` also makes a new node with one probe of its table (`entry`) where it looked the key up and then inserted it. Measured on a full-archive `leonida translate` (16 threads, mimalloc build), four interleaved pairs against main: wall 47.1 s -> 41.2 s, CPU (user + kernel) 654 s -> 574 s. The blake3 of every emitted DXIL (25,689 programs, 15,799 distinct) is the same as main's in all four runs. On the system heap the same pairs show no change (six pairs, CPU +0.5 %). Tests: the table keeps the newest of a set and forgets the rest, grows to its limit and keeps what it holds, and a diagram whose table holds four entries gives the same nodes, in the same places, as one with room for all, and every function holds where the one it stands for does. AI-assisted: Claude Sonnet 5.5 Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'runtime/test/active_input_test.cpp')
0 files changed, 0 insertions, 0 deletions