mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-28 01:11:23 +01:00
* Extract the material graph runtime from TextureCraft Preserve its evaluator, compiler, existing verification, and format reference from TextureCraft #777 at 22a37c29. Original TextureCraft importer author: xilefenko (TextureCraft #521). * Adapt graph helpers to the shared workspace lints Preserve node evaluation and version tracking while splitting long dispatch branches. Update the EXR doctest and rule table references for the shared crate. * Read the format reference with LF endings in its test * Test that the format reference example reads the same with CRLF line endings * Make the kind versions follow module attributes, arm order, raw strings, includes and the epoch * Fix graph cache keys, publish, import and subgraph extraction; harden the graph tests * Keep the cubic sampler from panicking on NaN texels; say what RGBE drops; check NaN halves by their bits * Lower vector inputs of f_to_bool and f_vec to valid WGSL; tighten the FX-map error and pattern coverage tests; document clamping and the splatter data cutoff * Say which composite glyph placements the font reader lacks; fail the y-up text test on a blank render * Leave publish as it was; unit-test the WGSL vector lowering; document EPOCH and keep_outputs results * Satisfy clippy in the version scanner and the WGSL lowering; compare cache hits by relation
3.1 KiB
3.1 KiB
| 1 | # Rule: a bilinear read between two texels a and b (16-bit levels) at a fraction f of the way from a's centre to b's: | |||||
|---|---|---|---|---|---|---|
| 2 | # the weight is w = round(f 256) (steps of 1/256), the read rounds half up to a 16-bit step: | |||||
| 3 | # (a (256 - w) + b w + 128) >> 8. It holds on 8-bit images too (their texels as 16-bit levels, k 257). | |||||
| 4 | # Tolerance: exact. Ours computes the read in single precision and rounds an exact tie ((a (256 - w) + b w) mod 256 = 128) | |||||
| 5 | # down, where the rule rounds it up: rows 1000/1001, 0/1 and 0/255 at w = 128 show it (ours one level below). Left as it is | |||||
| 6 | # (this table is part of a pure refactor); an implementation should follow rule_16. | |||||
| 7 | # Columns: a_16, b_16 = the two texels; fraction = f; weight_256 = w; ours_16 = our read; rule_16 = the integer form above. | |||||
| 8 | a_16 | b_16 | fraction | weight_256 | ours_16 | rule_16 |
| 9 | 0 | 65535 | 0.5 | 128 | 32768 | 32768 |
| 10 | 0 | 65535 | 0.25 | 64 | 16384 | 16384 |
| 11 | 0 | 65535 | 0.001953125 | 1 | 256 | 256 |
| 12 | 0 | 65535 | 0.005859375 | 2 | 512 | 512 |
| 13 | 0 | 65535 | 0.998 | 255 | 65279 | 65279 |
| 14 | 65535 | 0 | 0.3 | 77 | 45823 | 45823 |
| 15 | 1000 | 1001 | 0.5 | 128 | 1000 | 1001 |
| 16 | 0 | 1 | 0.5 | 128 | 0 | 1 |
| 17 | 0 | 255 | 0.5 | 128 | 127 | 128 |
| 18 | 100 | 300 | 0.49804688 | 128 | 200 | 200 |
| 19 | 23205 | 9379 | 0.19140625 | 49 | 20559 | 20559 |
| 20 | 44184 | 1928 | 0.5751953 | 147 | 19920 | 19920 |
| 21 | 20253 | 28201 | 0.66308594 | 170 | 25531 | 25531 |
| 22 | 19217 | 15864 | 0.4921875 | 126 | 17567 | 17567 |
| 23 | 25760 | 59925 | 0.6933594 | 178 | 49515 | 49515 |
| 24 | 44393 | 18066 | 0.9033203 | 231 | 20637 | 20637 |
| 25 | 33737 | 64148 | 0.68652344 | 176 | 54645 | 54645 |
| 26 | 31806 | 12044 | 0.28222656 | 72 | 26248 | 26248 |
| 27 | 22230 | 46673 | 0.6015625 | 154 | 36934 | 36934 |
| 28 | 43001 | 3460 | 0.8701172 | 223 | 8557 | 8557 |
| 29 | 5114 | 53420 | 0.31933594 | 82 | 20587 | 20587 |
| 30 | 2137 | 59564 | 0.25683594 | 66 | 16942 | 16942 |
| 31 | 45996 | 8602 | 0.095703125 | 25 | 42344 | 42344 |
| 32 | 53518 | 1262 | 0.7050781 | 181 | 16571 | 16571 |
| 33 | 37673 | 62477 | 0.9892578 | 253 | 62186 | 62186 |
| 34 | 37652 | 60350 | 0.024414063 | 6 | 38184 | 38184 |
| 35 | 57181 | 40640 | 0.4111328 | 105 | 50397 | 50397 |
| 36 | 17920 | 37069 | 0.73339844 | 188 | 31983 | 31983 |
| 37 | 24580 | 1032 | 0.26367188 | 68 | 18325 | 18325 |
| 38 | 1994 | 12127 | 0.48046875 | 123 | 6863 | 6863 |
| 39 | 21176 | 21113 | 0.8984375 | 230 | 21119 | 21119 |
| 40 | 6023 | 53015 | 0.18066406 | 46 | 14467 | 14467 |
| 41 | 30204 | 32869 | 0.018554688 | 5 | 30256 | 30256 |
| 42 | 40307 | 8659 | 0.3466797 | 89 | 29304 | 29304 |
| 43 | 11300 | 6018 | 0.37695313 | 97 | 9299 | 9299 |
| 44 | 26972 | 32708 | 0.0087890625 | 2 | 27017 | 27017 |
| 45 | 10762 | 8253 | 0.19921875 | 51 | 10262 | 10262 |
| 46 | 6189 | 41820 | 0.9404297 | 241 | 39732 | 39732 |
| 47 | 44567 | 10873 | 0.5625 | 144 | 25614 | 25614 |
| 48 | 22906 | 8718 | 0.48339844 | 124 | 16034 | 16034 |
| 49 | 1837 | 50800 | 0.052734375 | 14 | 4515 | 4515 |
| 50 | 46301 | 43366 | 0.6816406 | 175 | 44295 | 44295 |
| 51 | 20397 | 51736 | 0.23632813 | 61 | 27864 | 27864 |
| 52 | 6664 | 49061 | 0.0068359375 | 2 | 6995 | 6995 |
| 53 | 5506 | 35605 | 0.34375 | 88 | 15853 | 15853 |
| 54 | 839 | 5163 | 0.31054688 | 80 | 2190 | 2190 |
| 55 | 5384 | 13655 | 0.11816406 | 30 | 6353 | 6353 |
| 56 | 13595 | 13311 | 0.92871094 | 238 | 13331 | 13331 |
| 57 | 38314 | 41125 | 0.9160156 | 235 | 40894 | 40894 |
| 58 | 34905 | 51017 | 0.4267578 | 109 | 41765 | 41765 |
| 59 | 48618 | 39137 | 0.16796875 | 43 | 47025 | 47025 |
| 60 | 56931 | 7595 | 0.96972656 | 248 | 9137 | 9137 |
| 61 | 49621 | 8222 | 0.31347656 | 80 | 36684 | 36684 |
| 62 | 7799 | 23886 | 0.68652344 | 176 | 18859 | 18859 |
| 63 | 44152 | 53524 | 0.018554688 | 5 | 44335 | 44335 |
| 64 | 35010 | 54326 | 0.74316406 | 190 | 49346 | 49346 |
| 65 | 64408 | 27566 | 0.7890625 | 202 | 35337 | 35337 |
| 66 | 50880 | 35061 | 0.5341797 | 137 | 42414 | 42414 |
| 67 | 52598 | 46463 | 0.52246094 | 134 | 49387 | 49387 |
| 68 | 63325 | 22556 | 0.16992188 | 44 | 56318 | 56318 |