diff options
| author | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-30 07:33:03 -0600 |
|---|---|---|
| committer | bobcatchris <83428450+bobcatchris@users.noreply.github.com> | 2026-11-30 07:33:16 -0600 |
| commit | 986771506d5e2a4c13e5076edf8003f7ef920765 (patch) | |
| tree | a914c70d0c618b6d97f01218d208e0a5d9f8f710 /runtime/test/queue_proxy_test.cpp | |
| parent | 497bdd0391d404487a2115a9d77ec3894620f433 (diff) | |
leonida-shader: Bools::given from the literals a condition forces (D3D12-SHADER-STRUCTURE-GIVEN-FORCED)
`Bools::given(b, known)` restricted `b` by every atom `known` decides. It
found them one atom of `b` at a time: for each, build the conjunction of
`known` with the atom's negation (and with the atom) and compare it with
0. In `structure::finish`, which calls it for every block's guards,
branches and mask joins, that was 97 s of 114 s of a full-corpus
translation's 330 s of structure time (1.52 million calls, 5.4 million
atoms, 10.7 million `implies`).
What `known` decides is a property of its nodes alone: the literals that
hold on every path to 1. `Bools::forced` finds them in one pass over the
condition (a node's are its children's intersection, or the one child's
plus its own atom where the other is 0), and keeps them per node for the
later calls on the same condition (bounded, then it starts over); `given`
applies them to `b` in one restriction. Where nothing satisfies `known`
every atom of `b` is decided both ways and the old code took them as
true: kept (b at all-ones). The result is the same function, so the same
node.
- given_as_the_forced_literals_of_what_is_known_gives_what_testing_each_atom_gave
keeps the old algorithm as the reference and compares it with `given` for
every pair of 72 random functions (conjunctions of literals among them,
and the constants), and checks `forced` against `implies` for every atom.
With the intersection's comparison of values left out it fails.
- `restrict` (one atom) is only the test's reference now: cfg(test).
- docs/findings.md: where the translator's time goes, by stage and by size.
Output unchanged: `leonida translate` over the whole archive, the DXIL of
all 25,689 emitted programs (15,799 distinct) hashes the same in 4 runs of
the new build and 5 of the old. Wall clock 65.2/65.1/65.1 s -> 59.4/59.5/
61.6 s, CPU 890/894/889 s -> 818/820/821 s (Ryzen 7 7800X3D, 16 threads,
--release, alternating).
AI-assisted: Claude Sonnet 5.5
Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'runtime/test/queue_proxy_test.cpp')
0 files changed, 0 insertions, 0 deletions