Expand description
entviz — Rust reference port. The spec version it targets and emits is
SPEC_VERSION.
This crate is a full, self-contained entviz
implementation: the deterministic shared core (tokenization + quant
extension, the SHA-512 fingerprint, ftok median/quartile selection, the
Oklab color rules, grid selection), the format-specific parsers
(entropy), and the SVG renderer (pipeline::render). It passes the
shared conformance corpus at Tier A (render model) + Tier B (canonical
raster) for every render vector, rejects every error vector, and satisfies
every invariant pair. Certify with:
cargo build --release --bin entviz-conformance
# from the entviz repo:
PYTHONPATH=src:. python -m compliance.runner \
--impl-cmd '/path/to/entviz-rs/target/release/entviz-conformance'The entviz-conformance binary (src/main.rs) implements the stdin/stdout
contract in the entviz repo’s compliance/README.md.
Modules§
- characterize
- Entropy characterization model + label projection —
port of
src/entviz/characterize.py. - entropy
- Format-specific entropy parsing (port of
src/entviz/entropy.py). - keccak
- Minimal pure-Rust Keccak-256 (the original Keccak, NOT NIST SHA3-256).
- pipeline
- Full render pipeline: entropy string → SVG string.
Structs§
Constants§
- BASE64URL
- HEX
- MIDDLE_
DOMAIN_ TAG - Domain tag for the second, domain-separated digest. The trailing NUL is
included.
v6is the construction version (fixed), NOT the spec version. - POSSIBLE_
EDGE_ COLORS - SPEC_
VERSION
Functions§
- choose_
grid - closest_
palette_ color - compute_
fingerprint - median_
token - nucleus_
colors - Returns (bg_hex, fg_hex). Red is the low byte of the quant (CSS order).
- oklab_
lightness - quartile_
tokens - second_
digest second = SHA-512(DOMAIN_TAG ‖ core). Computed for every input; drives the two color-bar markers on all inputs (and the middle cells on large ones). A legitimate part of the renderer — not adversarial tooling.- select_
visual_ style - tokenize
- tokenize_
fingerprint - weighted_
rgb_ distance