Files
craft-libs/crates/material-graph/tests/rules/node_hold.tsv
T
Valentin Klein c3155aad96 Share the material graph runtime and WGSL pixel compiler (#3109)
* 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
2026-11-23 08:55:49 -05:00

2.7 KiB

1# Rule: what a node of the compiled format keeps of a value v, by its format (flags bits 4-5).
2# 8 bits (0x09): fine = round(v 65535) >> 4 (16 bits to the nearest, cut to 12), out = (255 fine + 2047) >> 12 (a tie goes
3# down: 0.5 gives 127). v is limited to 0..1 first.
4# 16 bits (0x19): fine = floor(v 2^20), out = (65535 fine + 2^19 - 1) >> 20; v limited to 0..1 first.
5# Half float (0x29): v cut to half precision towards zero, not rounded; below 2^-14 in steps of 2^-24; at 65536 and above,
6# and NaN or infinite, unchanged. Negative values cut the same way towards zero (assumed, not measured).
7# Tolerance: exact.
8# Columns: value = v (as f32); level_8 = k of k/255; level_16 = k of k/65535; half = the half-float node's value (as f32).
9valuelevel_8level_16half
100000
111255655351
120.5127327670.5
130.5019608128328960.5019531
140.002187501430.0021858215
150.002197265611440.0021972656
160.0568627451437260.056854248
170.0607843141639830.060760498
180.123529413280950.12347412
190.4372549112286560.43701172
200.5127327670.5
210.2564163840.25
220.75191491510.75
230.12565530.099975586
240.251131070.19995117
250.376196600.2998047
260.7178458740.69970703
270.9229589810.89990234
280.999255654690.99853516
290.0010650.0009994507
300.000015259022010.000015258789
310.000022888533010.000022888184
320.000007629511000.0000076293945
330.000021934844010.00002193451
340.000006675822000.00000667572
350.000030518044020.000030517578
360.000038147555020.000038146973
370.000022888533010.000022888184
380.000037193866020.0000371933
390.000021934844010.00002193451
400.001525902201000.0015258789
410.001533531701000.0015335083
420.00151827270990.0015182495
430.00153257801000.0015325546
440.0015173190990.0015172958
450.015259022410000.015258789
460.015266651410000.015266418
470.015251392549990.01525116
480.015265698410000.015258789
490.01525043949990.01524353
500.49999237127327670.49975586
510.5127327670.5
520.49998474127327670.49975586
530.49999905127327670.49975586
540.4999838127327660.49975586
550.5000076127327680.5
560.50001526127327680.5
570.5127327670.5
580.5000143127327680.5
590.49999905127327670.49975586
600.99998474255655340.9995117
610.9999924255655350.9995117
620.9999771255655340.9995117
630.9999914255655340.9995117
640.99997616255655330.9995117
65-0.2500-0.25
66-0.00000100-0.0000009536743
671.5255655351.5
682255655352
690.1253281920.125
700.333333385218450.33325195
710.6666667170436900.6665039
720.000061035156040.000061035156
730.00003020.000029981136
740.0000001000.000000059604645