Download the generated PDF manuscript
NUIF authored-interface interchange research manuscript
Architecture, executable profiles, resource packaging, reconstruction research and open risks
Refpath contributors
Version working-2026-08-31 · 2026-08-31
Manuscript status: working technical manuscript; not peer reviewed. This generated document does not change the status of any included specification module.
Abstract
This manuscript evaluates a layered authored-interface interchange model through prior-art synthesis, bounded adapter profiles and executable conformance experiments. It also separates proposed resource packaging, source-backed capture and screenshot reconstruction from the narrower implemented alpha evidence. It records the architectural hypothesis, implemented evidence, unresolved risks and governance conditions without claiming specification stability, reconstruction accuracy or universal format coverage.
Reproducibility
The body is compiled from 13 canonical whitepaper modules at source digest sha256:d554926f107ca96300cd2ac76757a15e9c9cbdc7ced95047e6d1f380ebc3712c. Editorial changes belong in those source modules.
NUIF foundation
NUIF investigates a portable, vendor-neutral draft specification for authored user-interface documents. The candidate model is intended to preserve meaning across editors and implementation targets rather than treating a rendered bitmap, a vendor scene graph, or source-language AST as the universal truth.
Thesis
A useful portable interface specification must coordinate several representations instead of collapsing them into one:
- semantic/document containment;
- component and instance identity;
- authored layout and responsive constraints;
- resolved geometry at explicit evaluation contexts;
- geometry, paint, typography, and assets;
- design-token references and themes;
- interaction/state and data-binding graphs;
- source/tool provenance and correspondence;
- extension payloads that can survive unknown intermediaries;
- deterministic operations, diff, patch, and reconciliation.
Portable resources add a second identity boundary: editable semantic assets retain stable IDs, while exact image/font bytes use immutable content digests. Package paths and source URLs are locators/provenance, not identity.
NUIF therefore treats portability as a synchronization problem as much as a serialization problem.
Architectural hypothesis
The working model is a small canonical core plus coordinated graphs and extension dialects. The containment tree answers ownership and order. Typed relationship graphs express constraints, components, tokens, interactions, provenance, dependencies, and other relationships that do not belong in a tree.
The reference implementation will preserve both authored and resolved state. Resolved state is always scoped to an evaluation context and is never allowed to silently replace authored intent.
Fidelity model
Every adapter and transformation must classify material mappings:
lossless— semantics are preserved exactly;representable— equivalent target semantics exist, even if encoded differently;approximated— a declared approximation is produced;preserved_unrenderable— data survives as an extension but the target cannot render/edit it;unsupported— data cannot currently be represented or preserved safely.
Silent loss is a conformance failure.
Explicit non-goals
NUIF does not promise to infer the unique original source program from pixels, reproduce arbitrary JavaScript execution, make every platform text renderer bit-identical, or force every target to support every capability. The draft specification should make such boundaries inspectable and machine-readable.
Screenshot reconstruction is therefore an optional inference client, not a new canonical truth. It may propose a validated editable hypothesis and calibrated alternatives, but screenshot-only evidence cannot be classified as lossless authored source.
Reference implementation role
The Rust implementation and editor are executable research instruments and conformance references. They do not define semantics by accident; normative behavior belongs in spec/ and must be testable independently.
NUIF architecture thesis
NUIF is a specification-first authored-interface model. Its center is neither a vendor editor nor a source framework.
Core thesis
A portable interface document must retain intent, structure, relationships and evaluated results simultaneously. A single flattened scene tree cannot preserve enough information for loss-minimizing round trips across editors and runtime frameworks.
The recommended architecture is a layered hybrid:
Document containment tree
│ stable IDs
├── component / instance graph
├── token / theme graph
├── layout constraint graph
├── interaction / state graph
├── provenance / correspondence graph
└── asset dependency graph
Authored model ──evaluate/lower──► resolved model ──► render scene
▲ │
└──────── reconcile / lift ◄────┘
Borrowed foundations
- MLIR: dialects, explicit lowering, partial legality and multiple abstraction levels.
- OpenUSD: non-destructive composition, references, layers and variants.
- glTF: small core, extension registry, used/required capabilities.
- DTCG: token interchange.
- SVG/Unicode/OpenType: geometry and text foundations.
- Retentive/symmetric lenses: synchronization with preserved source regions.
New work required
NUIF must define the missing combination: authored UI semantics + resolved state + cross-tool provenance + structural loss accounting + source patch synchronization.
Canonical layers
- Document layer — identity, containment, semantics, accessibility.
- Component layer — definitions, instances, slots, parameters, variants and overrides.
- Layout layer — authored sizing/layout intent independent of resolved geometry.
- Visual layer — geometry, paint, text and effects.
- Behavior layer — interactions, states, animation and data bindings.
- Resolved layer — computed layout, shaped text, flattened paint/effect plans for a declared evaluation context.
- Provenance layer — source/destination correspondence and fidelity diagnostics.
- Resource layer — stable semantic assets bound to content-addressed bytes, package/resolver locators and derivation records.
No lower layer is permitted to silently erase a higher-level authored construct. Lowerings that cannot represent a construct must emit fidelity records.
Stable identity
Identity is semantic and independent of path, order and display name. Moving an entity does not change its ID. Content hashes identify immutable resources and canonical snapshots, not editable semantic entities.
Compiler and reconstruction ports
Deterministic source adapters and probabilistic screenshot reconstruction meet at the operation boundary:
retained source + resolved host observations ─┐
├─> typed operations -> core
pixels + OCR/CV/model hypotheses ─────────────┘ -> render/evaluate
Source-backed and screenshot-only inputs retain distinct evidence classes. A model/provider is replaceable and cannot redefine the operation grammar, validator, layout semantics, resource identity or fidelity ceilings.
Falsifiability
The architecture fails if the v0 experiment cannot preserve a non-trivial responsive component through editor→HTML→NUIF→editor while retaining component identity, token bindings, layout intent, an opaque foreign extension and a minimal source patch after an edit.
The resource/reconstruction extension fails if independent package writers cannot reproduce the proposed bytes, if browser capture cannot be pinned without secret leakage, if visual objectives reward flat screenshot copies, or if adaptation fails to beat the untuned tool-assisted baseline on a frozen holdout.
Layout and rendering research synthesis
Layout is not geometry
NUIF separates authored constraints from resolved boxes. Fixed x/y/width/height are valid authored values for freeform content, but they are not the universal layout representation.
The initial layout vocabulary contains families rather than one universal algorithm:
freeform— transforms/anchors and explicit geometry.stack— one-dimensional flow with intrinsic sizing, distribution, alignment and gaps.flex— web-compatible flexible layout semantics.grid— bounded explicit fixed/frtracks, spans and deterministic no-implicit-track placement in profile 0; broader CSS Grid features remain capability-reported adapter input.constraint— relational linear constraints for editor/native-layout cases.custom— extension/dialect-defined evaluator with declared fallback/resolved geometry.
Common sizing primitives are normalized across families: fixed, intrinsic-min, intrinsic-max, fit-content, fill/available, percentage, min/max clamps, aspect ratio and content measurement.
Taffy is the recommended first evaluator for CSS-compatible block/flex/grid behavior because it implements web algorithms in Rust. SwiftUI’s proposal-response model and Cassowary-style constraints demonstrate why the canonical schema must remain a superset rather than serializing Taffy’s Style directly.
Evaluation context
Resolved layout is keyed by an explicit context including viewport/container size, pixel ratio, locale, writing direction, font set, token/theme selection and feature/dialect capabilities. Multiple resolved snapshots may coexist as caches or conformance fixtures.
Rendering semantics
The draft specification defines the visual meaning of paths, fills, strokes, transforms, clipping, masks, gradients, compositing, images, text and supported effects. It does not specify GPU command buffers or a renderer implementation.
The reference renderer uses a backend trait. Vello/wgpu is the leading interactive experiment, but conformance requires deterministic raster comparisons and must permit CPU reference rendering where GPU differences would make tests unstable.
Text
Canonical text remains Unicode text + style runs + semantic annotations + font references. Shaping produces resolved glyph IDs, clusters, advances and offsets using pinned font data and a declared Unicode/shaping version. A glyph cache never replaces semantic text.
Portability reports must distinguish font substitution, missing glyphs, line-break differences and rasterization differences from document-model loss.
Protocol, portability and synchronization
NUIF treats portability as an ongoing synchronization problem.
Operations
The protocol operates on stable entities and semantic properties. Operations include create/delete/move, set/unset property, list/set relation edits, component/instance overrides, token bindings, extension edits and transactions. Editor gestures lower to these operations.
A drag inside a stack should usually become a reorder or layout-property edit; a drag in freeform space may become a transform edit. GUI coordinates are input data, not the protocol abstraction.
Patch model
A patch is a deterministic ordered set of operations with base snapshot identity, optional preconditions, transaction metadata and provenance. Patches can be replayed headlessly.
Three-way merge uses stable identity first and structural matching only when identity is absent. Conflicts are typed: property, delete/edit, ordering, relationship, extension and semantic-lowering conflicts.
Correspondence
Adapters maintain correspondence records between NUIF entities/properties and foreign constructs such as DOM nodes, CSS declarations, Svelte component props or design-tool node IDs. Correspondence is separable from the canonical design so source-specific metadata can be detached when unnecessary.
Fidelity classes
Every adapter/evaluator may report:
lossless— semantics preserved and reconstructable.representable— equivalent semantics represented through different constructs.approximated— visible/behavioral approximation with known semantic loss.preserved_unrenderable— data retained opaquely but not understood/rendered.unsupported— data could not be safely preserved.
Silent degradation is a conformance failure.
Serialization, collaboration and governance
Logical model before encoding
NUIF defines one logical model with multiple conforming encodings.
Text form
A canonical, reviewable representation is implemented for examples, fixtures,
diffs and Git workflows. nuif-text-0 fixes number formatting, UTF-8 key order,
layout and strict decode/canonicalize behavior; later text profiles may evolve
only through explicit versioning.
Binary form
Deterministic CBOR is the profile-0 binary form because the NUIF profile closes the choices left by RFC 8949 without coupling the logical model to generated code. The executable codec gate finds it near 41% of canonical-text size at 4,096 entities on an Apple M5 Pro run, while its typed decode path is slower than text. That result supports CBOR as a compact canonical form, not as a universal latency winner.
A candidate is timed only after complete-model round trip, canonical fixpoint and unknown-data preservation through a neighboring edit. Protobuf does not specify canonical binary output. FlatBuffers deliberately permits different byte layouts and old readers ignore new fields, so a rebuilding editor needs a separate retention strategy. Cap’n Proto specifies a schema-agnostic canonical form and is the preferred next experiment, but it still needs a complete NUIF mapping, bounded old-reader edit trial and two agreeing canonical writers. Compiled zero-copy runtime caches remain separate, explicitly noncanonical profiles rather than replacements for authoring interchange.
The experimental package form separates manifest/document records from
content-addressed resources. RFC 0010 selects a candidate deterministic ZIP
profile with fixed mimetype, canonical manifest/document records and
SHA-256-addressed blobs. Bare encodings use explicit .nuif.json and
.nuif.cbor names. Exact ZIP header fixtures, two independent local writers and
bounded image/font segments now exist. Cross-platform and externally authored
writer evidence remains required before package-profile acceptance.
Semantic document, resource and package hashes have different scopes. Stable asset identity is not content addressing. Unknown extension payloads remain explicit typed bytes/values and must not depend on accidental codec unknown- field behavior.
Collaboration
Canonical documents do not require CRDT tombstones, clocks or replica metadata. A collaboration profile maps NUIF operations to an append-only/change structure and can use Automerge, Yjs or another convergent transport. Checkpoints serialize back to canonical NUIF.
This keeps offline files simple and permits multiple collaboration engines.
The executable register profile uses causal multi-value registers. The separate existing-tree profile replays uniquely ordered moves, rejects cycles, models deletion as profile trash and orders siblings through stable RGA-style origins. Semantic move and deletion conflicts remain visible even when the profile can choose a deterministic checkpoint. Automerge is presently tested as an operation-set transport, not claimed as an implementation of the tree algorithm.
Governance
Early development occurs in refpath/nuif, but the architecture assumes eventual neutral stewardship. A plausible progression is:
- OSS research/reference implementation under Refpath.
- public RFC process + implementer registry.
- independent community/working group once two independent implementations exist.
- investigate W3C Community Group for UI/document semantics and/or Khronos-style governance if renderer/asset vendors become primary stakeholders.
Specification text, schemas and conformance tests need clear royalty-free contribution/IP terms before claiming standards-track stability.
Prior art and competitive map
No surveyed system currently combines the whole NUIF thesis. Several solve important subsets.
| System | Strongest reusable idea | Gap relative to NUIF |
|---|---|---|
| Penpot | open inspectable design document; SVG mapping | shape-centric; not a cross-runtime synchronization standard |
| OpenPencil | programmable editor, Figma codec, DOM/CSS, CLI/MCP | editor ecosystem, not neutral standards governance |
| Figma | mature component/layout authoring semantics | proprietary canonical model and evolving vendor format |
| W3C UI Specification Schema CG | implementation-agnostic UI field/schema goal | closed 2026; schema approach lacked executable renderer/protocol proof |
| Open UI | component anatomy/states/accessibility research | web-control scope, not authored visual document exchange |
| SVG | vector geometry/paint interoperability | lacks high-level components/responsive authored layout |
| Lottie/Rive | portable animation and state-machine runtimes | animation/runtime focus rather than general UI authoring |
| DTCG | neutral token semantics | intentionally only tokens |
| OpenUSD | non-destructive layers/references/variants | 3D scene domain, not UI semantics |
| glTF | compact core + extension governance | delivery/runtime asset rather than authoring model |
| MaterialX | renderer-independent typed graph | material domain |
| MLIR | dialects/multi-level lowering | compiler infrastructure rather than document semantics |
| CSS | rigorous layout families and authored→formatting pipeline | web-specific cascade/DOM/runtime semantics |
| IFC/STEP | long-lived semantic interchange and profiles | complexity warns against over-generalizing the core |
Directly borrow
Stable standards concepts: SVG geometry, DTCG token values, Unicode/OpenType text foundations, CSS-compatible algorithms for matching profiles, glTF-style capability declarations, OpenUSD-style composition principles, MLIR-style dialect/lowering discipline.
Adapt
Retentive lenses → property/source correspondence; CRDTs → collaboration profile; WebRender/Vello/Skia → renderer boundary and conformance strategy; Tree-sitter → source-preserving adapter infrastructure.
Invent/prove
The proposed integration combines authored and resolved UI state, stable cross-tool semantic identity, opaque extension retention, fidelity accounting, bidirectional semantic patches and a native open editor whose internal state is the draft model itself.
Implementation language and runtime choice
Decision: Rust reference core
Rust is the strongest default for the reference implementation because the project simultaneously requires untrusted binary parsing, graph/document transforms, geometry, text shaping, native/WASM embedding, GPU access, fuzzing and stable C-compatible boundaries.
Alternatives
- C++ has the deepest graphics ecosystem and mature Skia/Yoga integration, but expands memory-safety risk in parsers/plugins and makes a browser/WASM-safe reference core less attractive.
- Zig offers excellent systems control and C interoperability but has a smaller mature graphics/text/schema ecosystem and less API stability for a standards reference implementation.
- Go is strong for services/tooling but weaker for low-level rendering/WASM/native GUI integration and deterministic allocation-sensitive engines.
- TypeScript is ideal at web/editor adapter boundaries but unsuitable as the only renderer/codec/reference-core implementation.
Stack
- Rust: document model, operations, layout abstraction, codec, renderer scene, conformance, WASM bindings.
- Taffy: initial CSS-compatible evaluator behind NUIF types.
- Vello/wgpu: interactive renderer experiment behind a NUIF renderer trait.
- HarfBuzz-compatible shaping: text experiment with pinned font inputs.
- Masonry + AccessKit: reference editor shell (ADR 0006, accepted; toolchain 1.98.0, MSRV 1.96); Svelte 5 + TypeScript for the later browser demonstration over the WASM bindings.
- Tree-sitter/language-native parsers: source adapters where concrete syntax retention is required.
Adapters MAY be written in the ecosystem-native language; conformance is against behavior/protocol, not implementation language.
Risk register and impossibility boundaries
Fundamental boundaries
- Rendered output is underdetermined. Pixels/boxes cannot uniquely reveal whether layout came from flex, grid, constraints, absolute positioning or runtime code. Imported foreign content must mark inferred intent.
- Arbitrary program behavior is not serializable as UI structure. NUIF does not promise to recover arbitrary JavaScript/Swift/Dart application logic.
- Text is environment-sensitive. Font files, shaping versions, fallback and rasterization can differ. Exact conformance requires pinned inputs; portability must classify substitution separately.
- Platform-native controls differ. Semantic equivalence may be possible while exact visuals/behavior are platform-specific.
- Effects/shaders can exceed a portable core. Extensions may be preserved without being renderable.
- Standard complexity can kill adoption. IFC/STEP demonstrate the cost of excessive semantic scope.
- A single reference implementation can accidentally become the spec. Independent implementation is a standards gate.
- Resource bytes carry legal and security constraints. Exact font/image preservation does not imply permission to redistribute or safe decoding.
- Visual metrics are gameable. A flat screenshot can look exact while discarding editability, semantics, accessibility and responsive behavior.
- Model confidence can be misleading. Raw probability is not calibrated correctness and cannot upgrade inferred evidence into source truth.
- Capture can leak secrets. Browser/network/accessibility observations may expose credentials, personal data or proprietary content unless collection, export, retention and training are separately bounded.
Containment strategies
- explicit fidelity reports and inference confidence;
- authored + resolved snapshots instead of pretending either alone is canonical truth;
- opaque extension preservation;
- deterministic capability/evaluation contexts;
- small core + profiles;
- reference implementation backed by normative conformance fixtures;
- fuzzing/resource budgets for all untrusted inputs;
- early independent implementation and adapter experiments.
- stable asset IDs separated from resource digests, locators and provenance;
- verify resource size/digest before decoding and never fetch implicitly;
- typed operation output for models, atomic validation and finite correction loops;
- structural/text/resource/edit-task metrics alongside visual diagnostics;
- calibrated decision-level confidence, alternatives and abstention;
- private captures default to local processing, no retention and no training.
Current implementation risks
- The macOS graphics fork is a maintenance boundary. The editor pins
refpath/xilemcommit1b96eb8; its parenteabfe0amoves the active renderer from wgpu 28 and metal-rs to wgpu 29 and the objc2 Metal bindings. The fork changes public API call sites and does not patch the Objective-C blocks ABI. Each fork update requires the editor tests, reverse dependency trace, and macOS Metal window smoke test recorded innuif:research:macos-metal-block-future-incompatibility. A separaterefpath/metal-rsmove-to-block2branch exists only for review; NUIF does not depend on the deprecated binding or that experimental patch. - Release signing is credential-bound. The editor packaging gate builds, archives and smoke-tests an unsigned host package. Platform signing and notarisation require release credentials and remain separate from source conformance.
- Portable resources are only narrowly implemented. The deterministic package, RGBA8 PNG and static single-face TrueType subsets have executable gates, while CPU profile 0 remains unchanged. RFC 0010 cannot be accepted until broad media/font matrices, the configured Linux/Windows/macOS jobs produce passing hosted evidence, external reproduction, calibrated aggregate budgets and interoperability review pass.
- Capture and reconstruction accuracy remains unestablished. RFC 0011 and specification 14 now have bounded fixed-input contracts, a local pinned browser fixture and a typed synthetic evaluation report. They establish interfaces, refusal rules and metric consistency, not portable browser-capture or screenshot-reconstruction accuracy. No current release makes those accuracy claims.
Thesis falsifiers
The project should rethink its architecture if ordinary source round trips require broad regeneration, if unknown extension preservation cannot survive routine edits, if the layout vocabulary becomes a vendor-property dump, or if a second implementation cannot reproduce v0 behavior from specification + fixtures alone. The resource/reconstruction path should additionally narrow if package bytes cannot reproduce across writers, correction loops improve pixels by deleting semantics, confidence cannot support useful risk/coverage, or tuned models do not beat the untuned tool-assisted baseline.
Governance and standardization strategy
NUIF starts under Refpath because research and implementation need a concrete home, but the target is neutral stewardship.
Repository governance now
- Public RFCs for semantic changes.
- ADRs for reference-implementation choices.
- Research evidence is distinct from normative requirements.
- Extension registry changes require examples and conformance fixtures.
- No vendor adapter can redefine core semantics.
Standardization path
A W3C Community Group is a plausible early venue for document/component semantics and coordination with Open UI/DTCG, but NUIF should not enter formal standards work before an executable v0 and at least one external implementer exist. Khronos/ASWF-style governance offers useful precedent for graphics/rendering and extension registries. A neutral foundation can become appropriate once multiple vendors/projects depend on the format.
IP/licensing goals
- reference code: permissive dual MIT/Apache-2.0;
- specification/schema/conformance text: permissive terms compatible with standards adoption;
- contributions: explicit patent/IP policy before standards-track claims;
- trademarks/conformance branding: separate from implementation copyright.
The project must not call itself an industry standard merely because the repository is public. Conformance, multiple implementations and neutral governance are prerequisites.
Naming and project identity
NUIF is the current working name and repository slug, not yet a cleared standards trademark.
A public reconnaissance found prior acronym use in an old Nexus User Input Framework and in a 2024 computer-vision paper, plus unrelated uses. None currently appears to occupy the same open UI-authoring interchange category, but collision risk is non-zero.
The architecture therefore separates human branding from protocol identity. Stable schema namespaces, extension IDs and version identifiers must not depend on a product trademark remaining unchanged.
Before v0.1 branding is promoted outside the research project:
- perform repository/package/domain/trademark clearance in key jurisdictions;
- decide whether
NUIFis an acronym or simply a proper project name; - reserve crate/package/extension namespaces;
- define conformance-mark governance separately from the open specification;
- make any rename before third-party persisted documents become common.
Research coverage and continuous completeness
A research repository cannot truthfully claim to contain every paper that will ever be relevant. NUIF instead defines operational completeness: every planned architectural front must have an explicit status, evidence links, unresolved questions and an experiment/decision path.
research/coverage.yaml is the machine-readable coverage contract. It maps the founding research plan to research IDs, specification modules, RFCs/ADRs, code seams and experiments. The project can therefore identify gaps structurally rather than relying on prose search to infer that a topic was forgotten.
Current state
All founding fronts are represented. The resource, browser-capture,
reconstruction-evaluation, adaptation/distillation and AI artifact-governance
fronts are now explicit rather than hidden inside “serialization” or
“inference.” Decisions that can safely be made from mature prior art are marked
covered. Questions whose answer would be premature without an implementation
are marked experiment-required. Areas whose evidence base will continuously
evolve—prior art, adapters, reconstruction and data/model governance—remain
ongoing by design.
This distinction is important: marking an open research problem as finished would be less rigorous than preserving it as a first-class graph node.
Additional boundaries from the final sweep
- WAI-ARIA and accessibility API mappings support a semantic-role/state layer
distinct from platform-specific accessibility trees. The bounded
nuif-web-accessibility-0lowering now proves computed role/name/state agreement for one eleven-node fixture across pinned Chromium, Firefox and WebKit while retaining native-platform and behavior non-claims. - KHR_interactivity provides contemporary precedent for portable,
capability-aware behavior graphs rather than arbitrary scripts embedded in
visual nodes. The smaller
nuif-behavior-state-machine-0sidecar now has exact Rust/Node traces for ordered guards, state, effects and explicit required/optional capability handling without claiming a final semantic schema. Its first wire experiment is one inert canonical-CBOR, content-addressed package resource: a Rust gate validates document binding and hostile cases while an independent Python ZIP reader checks exact container bytes. The attachment remains outside the canonicalDocumentand never grants execution authority. A separate one-way web lowering maps the bounded effects through native activation,hiddenand an ARIA status region; five events agree across pinned Chromium, Firefox and WebKit under one exact CSP-hash-authorized runtime without extending that evidence to native UI or screen-reader speech. - ReverseORC and related layout-inference work show that multiple viewport observations materially improve recovery of responsive intent.
- Screenshot-to-code research continues to show that visual reconstruction is not equivalent to recovering authored layout or behavior.
- Merkle/content addressing is appropriate for immutable assets and snapshots but not for editable semantic identity.
- EPUB OCF and OCI descriptors support a narrow manifest-driven package with size/digest verification; NUIF now has an in-repository independent-writer fixture. A three-OS CI matrix now exercises the package, image and font gates, while successful hosted evidence and external reproduction remain open.
- OpenType and Fontations evidence now supports one executable static TrueType
package baseline with a pinned HarfBuzz metadata oracle. The retired
ttf-parserdecision remains documented; broad font formats, portability outcomes and shaping/raster integration remain experiment-required. Warmed parser and packaged-validation allocation ceilings cover every accepted fixture. - Browser source capture and screenshot reconstruction are different evidence
lanes and cannot share a blanket
losslessclaim. - Current screenshot-to-code work supports OCR/region/hierarchical and render- correction experiments, not a claim that authored UI recovery is solved.
- LoRA, quantized adaptation and distillation are conditional experiment techniques; evaluation, rights-cleared traces and artifact governance precede training.
The continuous-research process should periodically re-run topic searches, append or supersede research records, and update research/coverage.yaml only when new evidence or experiments change the status of a front.
Cross-industry patterns: evidence, adoption and rejection
This document synthesizes 52 research records added on 2026-08-29 from visual-effects interchange, game-engine asset systems, programming-language research on bidirectional transformation and layout verification, distributed-systems testing, and 2D-rendering conformance practice. Each pattern below is classified as borrowed (adopted as is), adapted (adopted with a stated change) or rejected (ruled out with the reason). Record identifiers (nuif:research:*) carry the locators; this document does not repeat them.
Method
The 52 records synthesized here were reviewed from primary sources (specifications, source code at a named commit and papers with DOI). reviewed does not mean every material claim has completed locator-level verification; research/AUDIT.md defines the stricter verified state. Claims resting on one record inherit its evidence status as well as its confidence. Source conflicts remain explicit until an RFC or experiment resolves them.
Patterns
Document model and composition
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
| Opinion strength ordering over composition arcs (LIVERPS) | openusd-composition-and-crate | Adapt: NUIF needs a total, documented resolution order for library, theme, variant and instance-override opinions; six arc kinds are more than a UI document needs | spec/03-components-and-composition.md, question composition-strength |
| Flatten as an explicit, named lowering that discards composition | openusd-composition-and-crate, alembic | Borrow: flattening is a lowering with a fidelity record, never the save format | spec/00-conformance.md, docs/whitepaper/01-architecture.md |
| Authored network versus cooked output with pull-based, memoized evaluation and push-based dirtying | houdini-pdg-and-hda, hydra-render-delegate | Borrow for the evaluator: resolved snapshots are pull-evaluated per context and invalidated by hierarchical locator sets rather than global dirty bits | crates/nuif-layout, ADR 0002 |
| Prefab override as a sparse modification set against a source definition | unity-prefabs-and-yaml-merge | Borrow: instance overrides are sparse property sets keyed by stable identity and property path | spec/03-components-and-composition.md |
| Resolved-only interchange (baked samples) | alembic | Reject as a canonical form; accept as an explicit cache profile | spec/08-serialization.md |
Identity and ordering
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
| File-local numeric identity with global identity through a second key | unity-prefabs-and-yaml-merge, godot-tscn-scene-format | Reject: file-local identities orphan cross-file references on replacement; NUIF identities are global from creation | spec/02-identity-and-properties.md |
| Path-based addressing in patches | json-patch-rfc6902-and-merge-patch | Reject for entities; retain for property paths inside an identity-addressed operation | spec/06-operations-and-patches.md |
| Parent link and fractional position as one atomic property | figma-multiplayer-and-rendering-engineering | Adapt: parent and anchor move together; collaboration profiles may use list identifiers internally, while canonical operations use Start/After(id) anchors | RFC 0006, crates/nuif-protocol |
| Tree move with undo/redo of concurrent operations and cycle rejection, mechanized proof | crdt-tree-move-operation | Adapt for the collaboration profile; the canonical document keeps a totally ordered log and needs no replica metadata | spec/10-collaboration-profile.md |
| Random resource identifiers with path fallback and warnings | godot-tscn-scene-format | Borrow the fallback discipline for asset references; a resolved-by-path reference must be diagnosed | spec/09-provenance-and-fidelity.md |
Unknown data preservation and schema evolution
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
UnknownSchema keeps name, version and raw payload and re-emits it verbatim; round trip asserted by a test | opentimelineio | Borrow verbatim: this is the executable form of nuif:claim:opaque-preservation | rfcs/0002-extension-preservation.md, experiment unknown-extension-roundtrip |
| Unknown node class preserved as a placeholder that records its original class and properties, written back on save | godot-tscn-scene-format | Borrow: entities of unknown kind are preserved, not dropped, and their original kind is restored on export | spec/07-extensions-and-dialects.md |
| Unknown data ignored and not re-saved | blender-dna-rna-and-headless | Reject: this is the failure mode NUIF exists to prevent | risk register |
| Per-schema version numbers with gap-tolerant upgrade functions and a generated version manifest | opentimelineio, unreal-asset-versioning-and-automation | Adapt: each core record kind carries a version; migrations are pure functions registered per kind; reading a newer version than known is an error, not silent loss | spec/08-serialization.md, migrate command |
| Self-describing struct layout embedded in the file | blender-dna-rna-and-headless | Reject: NUIF encodings are schema-versioned, not struct-layout-described; the deterministic CBOR profile already carries structure | ADR 0004 |
| Extension prefix registry with a status ladder that requires validator support before release | gltf-validator-and-sample-assets | Borrow: EXT namespaces are promoted only with a conformance fixture and validator rule | question extension-governance |
Operations, undo and merge
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
| Every editor action is an operator with typed parameters, invocable from scripts | blender-dna-rna-and-headless | Borrow: every editor gesture lowers to a protocol operation that a script can invoke | RFC 0004 |
| Memento-based transaction snapshots | unreal-asset-versioning-and-automation, blender-dna-rna-and-headless | Reject for the canonical log; inverse operations are recorded instead, because snapshots do not commute and cannot be merged | spec/06-operations-and-patches.md |
| Undo restores expected user state under concurrent edits; undo rewrites redo history | figma-multiplayer-and-rendering-engineering, command-pattern-undo-and-event-sourcing | Adapt: the invariant “undo, copy, redo leaves the document unchanged” becomes a metamorphic relation in the operations suite | conformance/HARNESS.md |
| Structural three-way merge keyed by class and identity with declared set-valued fields and float epsilons | unity-prefabs-and-yaml-merge | Borrow: a merge-rules declaration per property kind (ordered list, identity set, scalar with tolerance) | spec/06-operations-and-patches.md |
| Tree matching becomes the identity map when stable identifiers exist; the residual problem is move and order conflicts | ast-diff-gumtree-and-structural-merge | Borrow: no heuristic matching in NUIF-native merges; GumTree-style matching is reserved for adapters without identity | docs/whitepaper/03-protocol-and-portability.md |
| Conflicts as first-class states rather than failures | patch-theory-darcs-pijul | Borrow: typed conflict objects are document state until resolved | spec/06-operations-and-patches.md |
| Operational transformation with server serialization | operational-transformation-vs-crdt | Reject as a canonical model; permissible as a collaboration profile | ADR 0005 |
Canonical encoding
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
| RFC 8949 §4.2 core deterministic encoding rules | canonicalization-rfc8785-and-cbor-deterministic | Borrow | nuif-cbor-0 |
| Float handling: CDE keeps numeric kinds while dCBOR reduces integral floats and zero | same, cbor-data-model-and-key-order-correction | Preserve NUIF’s declared integer/real kinds; canonicalize both real zeros to positive floating zero | RFC 0008 |
RFC 8785 number serialization via shortest round-trip and -0 to 0 | same | Adapt for nuif-text-0 | spec/08-serialization.md |
| Content-addressed deduplication of array values | openusd-composition-and-crate, alembic | Borrow for the package asset store; reject for editable entities | ADR 0004 |
Layout
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
Fixture tests generated from browser layout through WebDriver, compared at < 0.1 px, with structural (not numeric) handling of known divergences | taffy-and-yoga-browser-generated-tests, differential-testing | Borrow: the layout differential suite is generated, never edited by hand; divergences are classified per case | experiment layout-differential |
| Layout as SMT-solvable constraints with a visual assertion logic | cassius-web-layout-verification | Adapt: the assertion vocabulary (no overlap, containment, alignment, text fits) becomes a fixture-level oracle; the SMT encoding itself is out of scope because no formalization covers flex or grid | conformance/HARNESS.md |
| Relational constraint synthesis from multi-device examples | inferui-and-layout-synthesis | Adapt for import inference only; results are marked inferred with confidence | experiment layout-inference |
| Flexbox §9.9.1.2 placeholder and grid intrinsic-sizing divergences | css-flexbox-grid-algorithm-specs | Record: NUIF conformance cannot claim exact agreement where the CSS specification is implementation-defined; such cases are tolerance-tiered | spec/04-layout.md |
Rendering determinism
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
| Renderer as a pluggable backend behind a stable scene abstraction | hydra-render-delegate | Borrow (already ADR 0003) | crates/nuif-render |
| GPU shaders as ground truth compared by a perceptual mean | vello-testing-and-cpu-reference | Reject as the conformance oracle; borrow the threshold values for the interactive backend | conformance/HARNESS.md |
CPU f32 pipeline with tolerance 0 inside Vello’s own harness | vello-testing-and-cpu-reference, resvg-test-suite | Treat as candidate evidence, not proof of cross-platform identity; calibrate NUIF’s path with pinned assets and a CI matrix | render-tolerance experiment, ADR 0003 |
Per-test numeric and perceptual thresholds (idiff, oiiotool, WPT fuzzy, WebRender fuzzy(max,count)) | hydra-render-delegate, blender-dna-rna-and-headless, skia-gold-and-gm-tests, webrender-reftests | Adapt into three declared tiers: exact, bounded per-channel delta with pixel count, perceptual (ꟻLIP mean) | conformance/HARNESS.md |
| Reftests (two documents that must render identically) over pixel baselines | skia-gold-and-gm-tests | Borrow for equivalence-preserving rewrites | metamorphic relation class 1 |
| Scene capture to a text serialization for deterministic replay | webrender-reftests | Borrow: render scenes are serializable fixtures | crates/nuif-render |
| WGSL and WebGPU leave rounding, reassociation, sample locations and edge inclusion implementation-defined | gpu-rendering-nondeterminism | Record: GPU output is never normative | spec/05-geometry-paint-text.md |
Text
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
Shaping fixtures as glyph strings with font hash, options and expected glyph=cluster@dx,dy+adv output | text-rendering-reproducibility | Borrow the format for the text suite | experiment text-pinning |
| Hinting off, grayscale coverage, declared subpixel quantum, font SHA-256, Unicode and shaper versions pinned | same | Borrow | spec/05-geometry-paint-text.md |
Testing methodology
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
| Deterministic simulation: single-threaded scheduler, seeded PRNG, all nondeterminism behind injectable interfaces, reproduction by seed | deterministic-simulation-testing | Borrow: the trial loop is seed-driven and prints the seed on failure | conformance/HARNESS.md |
| Swarm testing (random feature subsets per run) | same | Borrow for operation generators | same |
| Metamorphic relations with tolerant equality; reduction by reversing recorded transformations | metamorphic-testing-graphics | Borrow: nine relation classes are defined in the record | same |
| ddmin over operation sequences, hierarchical reduction over the document, choice-sequence shrinking over generated values | delta-debugging-and-test-case-reduction | Borrow: three-level reducer | QA contract item 9 |
| Model-based testing with a small reference model and precondition-preserving shrinking | property-based-testing-state-machines | Borrow: proptest-state-machine over an ordered-forest model | same |
| Structure-aware fuzzing with explicit depth and allocation budgets | fuzzing-structured-inputs | Borrow: arbitrary does not bound value depth; NUIF bounds depth and node count explicitly | spec/11-security.md |
| Snapshot testing with redactions, sorted output and a single update variable | golden-master-and-snapshot-testing, libtest-mimic-and-data-driven-fixtures | Borrow: NUIF_UPDATE_EXPECT is the only regeneration switch | conformance/HARNESS.md |
| Machine-readable validation report with severity codes, pointers and per-code policy | gltf-validator-and-sample-assets | Borrow as the report schema for validate, import, export | spec/12-cli-api-and-automation.md |
| Sample-asset corpus with per-asset metadata, tags and CI validation | same | Borrow for conformance/fixtures | conformance/HARNESS.md |
Editor automation
| Pattern | Source | Decision | NUIF artifact |
|---|---|---|---|
Headless execution with a script (--background --python, hython, commandlets, -nullrhi) | blender-dna-rna-and-headless, houdini-pdg-and-hda, unreal-asset-versioning-and-automation | Borrow: the editor binary runs a session script without a window | apps/editor/UI-SPEC.md |
| Plugin API as a programmable surface, but no headless mode and read-mostly REST | figma-plugin-and-rest-api-as-automation-surface | Record as the gap NUIF closes; borrow pluginData-style opaque per-entity stores as adapter evidence | adapters/README.md |
| Accessibility tree as the semantic query and action surface for UI tests | accesskit-semantic-ui-testing, egui-and-egui-kittest, masonry-xilem-and-linebender-test-harness | Borrow: entity identifiers are carried in the accessibility tree; tests query by role and label and dispatch actions without pointer synthesis | ADR 0006 |
| Same-frame scene and accessibility outputs with virtual time and CPU rasterization | masonry-xilem-and-linebender-test-harness | Borrow | ADR 0006 |
| Pixel-based UI screenshot tests with per-OS thresholds | egui-and-egui-kittest | Reject as the primary editor oracle; permitted only for shell wiring | apps/editor/QA.md |
Ruled out
The following were examined and excluded from the architecture; the reason is recorded so the question is not reopened without new evidence.
- A self-describing binary struct layout (Blender DNA): solves version drift for one implementation but does not preserve data it cannot re-save and does not compose with a schema-versioned interchange model.
- Memento undo as the canonical history: does not commute, cannot be merged, and bloats logs; inverse operations are required by
spec/06. - Integer child indices in
MoveandInsertas the only order representation: non-commutative under concurrency; a list identifier is required for the collaboration profile and harmless for the canonical form. - GPU rendering as a normative oracle: implementation-defined by the WebGPU and WGSL specifications.
- Perceptual UI screenshot tests as the primary editor test: platform-dependent text rendering makes them a shell-wiring check only.
- Heuristic tree matching for NUIF-native merges: unnecessary with stable identity and a source of spurious moves.
- Whole-project regeneration as the synchronization model: contradicted by the lens and delta-lens laws that NUIF’s patch model must satisfy (
lenses-foster-boomerang,bidirectional-evaluation-direct-manipulation).
Consequences for the specification
The records imply the following changes. Items 1–3 were decided by follow-up research on 2026-08-29 and are recorded as accepted RFCs; items 4–6 remain proposals.
- Sibling order is a canonical array without keys;
InsertandMoveuse anchors (Start,After(id)); the collaboration profile maps anchors onto a Fugue-family list CRDT (RFC 0006). nuif-cbor-0follows deterministic preferred serialization while preserving integer/real data-model identity; real zero is positive floating zero, text and CBOR key orders are distinct, strict decoders reject non-canonical input, text hashes through CBOR and strings remain verbatim (RFCs 0005 and 0008).- Entities of unknown kind load as
Unknownwith typed core fields and an opaque payload; ignorant implementations preserve bytes, knowing ones may re-encode; validation severities follow the glTF pattern (RFC 0007). - Every serialized record kind carries a schema version; migrations are registered pure functions; newer-than-known versions load as
Unknownfor entities (RFC 0007) and are diagnosed for other records. - Validation, import and export reports follow one schema with stable codes, severities and pointers.
- Layout conformance declares tolerance tiers per case and classifies every divergence from a browser reference as schema loss, evaluator defect or implementation-defined behavior.
Open questions raised by this synthesis
Recorded in research/questions.yaml: cbor-float-zero (decided, RFC 0005), sibling-order-identifier (decided, RFC 0006), unknown-kind-preservation (decided, RFC 0007), editor-toolchain-msrv (ADR 0006), layout-assertion-vocabulary, render-tolerance-tiers.
Resources, capture and model-neutral reconstruction
NUIF’s next research front is not “add an AI converter.” It is a coordinated resource, capture and reconstruction architecture with explicit truth boundaries. Images and fonts must survive as verified resources. Source-backed browser imports must retain authored/resolved evidence. Screenshot-only imports must remain honest probabilistic hypotheses. Every path converges through one core operation, validation, rendering and fidelity contract.
Decision summary
The recommended direction is:
- define stable assets separately from immutable byte resources;
- make
.nuifa deterministic portable package after cross-writer proof; - grow the executable narrow PNG and static TrueType resource baselines only through named profiles and measured hostile-input budgets;
- add a pinned browser-capture adapter separate from static source sync;
- build screenshot reconstruction as a replaceable observation/proposal loop;
- freeze a structural and visual evaluation suite before training;
- consider adaptation or distillation only after the untuned loop exposes a repeatable learnable error distribution.
RFC 0010 and RFC 0011 remain proposed contracts. Their bounded package, narrow PNG/static-font and capture/reconstruction experiments are implementation evidence only for the named subsets; they are not published conformance or standards claims.
One core, two import lanes
Source-backed lane
HTML/CSS + browser execution + resource responses
-> retained source + resolved observations
-> deterministic adapter/lowering + explicit inference where needed
|
v
typed NUIF operations
|
v
core validation/apply
|
v
resource-aware NUIF
^
|
Screenshot-only lane |
pixels + context |
-> OCR/CV/grounding observations
-> hierarchy/layout/resource hypotheses
-> typed operations -> render/diff/correct
The lanes differ in evidence, not in their mutation authority. Both use the same typed operations. Neither provider can write core structs directly. A browser observation may support an exact resolved value under one pinned context, but it does not automatically reveal authored intent. A screenshot cannot establish source equivalence regardless of visual score.
Portable resource model
Four identities must remain distinct:
| Concern | Identity | Change behavior |
|---|---|---|
| editable semantic asset | AssetId | stable when its content is replaced |
| immutable encoded bytes | ResourceDigest | changes for any byte change |
| package/resolver location | locator | may change without changing bytes |
| source/derivation history | provenance record | may grow without renaming asset/bytes |
An asset points to a content descriptor containing media type, SHA-256 and byte length. A package path or external URL only locates candidate bytes; size and digest are checked before decoding. External resolution is opt-in. Opening a document never triggers network access.
Resource roles clarify hash and retention behavior:
source: original encoded bytes;authoring: exact bytes needed to evaluate/edit semantics;derived: crop, trace, selected frame, conversion or generated result with input digests and transformation identity;cache: decoded pixels, GPU textures or acceleration state that can be deleted without changing the semantic document.
This avoids a common failure: storing only a decoded bitmap and calling the source image preserved, or hashing an editable asset by its current bytes and therefore breaking every reference after replacement.
Candidate .nuif package
The proposed first package is a deliberately small deterministic ZIP profile:
mimetype
manifest.cbor
document.cbor
blobs/sha256/<digest>
mimetype is first and stored. Manifest and document are deterministic CBOR.
Every embedded blob is addressed by exact SHA-256 bytes. The first profile uses
stored members only, fixed metadata and sorted ASCII paths to make independent
writer byte equality attainable and to avoid compression-version variability.
There are three hashes:
- semantic document hash over canonical
document.cbor; - resource digest over each exact blob;
- package hash over the exact ZIP artifact.
Cache or report changes may change the package hash while leaving the semantic
document hash untouched. Bare canonical forms remain .nuif.json and
.nuif.cbor. Historical alpha .nuif raw files need read-only detection during
migration; new .nuif output becomes the package only after RFC acceptance.
The package reader rejects duplicate or unsafe paths, symlinks, directories, encryption, split archives, unsupported compression, inconsistent headers, undeclared/missing blobs and digest mismatch. It does not extract to a filesystem. Exact byte fixtures, member/resource limits and two independent writers are acceptance gates.
Package-to-session handoff uses shared immutable buffers. The release gate passes an 8 MiB resource through package, handle map and session with the same allocation pointer while keeping handoff allocator traffic and retained bookkeeping below 1 MiB. This prevents a host from paying one full resource copy merely to enter the core.
Images
The original encoded image is authoritative. A semantic image asset records its resource digest and intrinsic interpretation; each image paint records fit, crop, transform, sampling, opacity and color conversion. Derived decoded pixels and GPU textures are caches.
PNG is the correct first format because its current W3C specification covers
lossless encoded pixels, alpha and explicit colour metadata. The executable
nuif-png-rgba8-0 baseline chooses an intentionally smaller contract:
non-interlaced RGBA8, no ancillary metadata or one valid sRGB chunk, encoded
samples interpreted as sRGB, straight decoded alpha, identity encoded orientation,
declared fit/crop/sampling/opacity and bounded integer CPU composition. png
0.18.1 and zune-png 0.5.2 must emit identical RGBA bytes for the accepted
fixtures; encoded resources remain digest-identical through package edits.
This avoids pretending that decoder agreement on simple images settles PNG
Third Edition. The compatible nuif-png-basic-rgba8-1 profile now admits the
lossless-to-RGBA8 subset: 1/2/4/8-bit greyscale and indexed images, RGB8,
greyscale-alpha8, RGBA8 and valid palette/colour-key transparency. It preserves
encoded bytes and requires exact normalized RGBA agreement between both
decoders. It is separately named so profile zero never changes meaning.
Image-paint affine semantics are orthogonal to decoder choice. The executable
matrix [a c tx; b d ty; 0 0 1] maps crop-local source coordinates forward
into the fitted rectangle. The CPU reference inverse-maps destination pixel
centers, clips to the entity, and rejects singular or numerically unbounded
matrices. Flip, rotation and translation fixtures make composition order
observable; live host trials are still required for vendor interoperability.
Decoded pixels are interned once per digest/profile in the renderer-independent scene and commands carry compact deterministic handles. A 64 MiB total is preflighted before each new inflation. The release gate retains one 1 MiB surface for 1,024 image instances under 8 MiB allocated and 4 MiB retained, and rejects a 64 MiB plus 16 byte declared total before the second decode.
Any broader profile still has to pin:
- accepted chunks and metadata conflicts;
- color-space precedence and output space;
- Exif orientation;
- conversion and premultiplication points for every accepted colour signal;
- sampling and compositing;
- encoded, pixel, decoded-byte, chunk and metadata limits;
- independent decoder and malformed-input fixtures.
16-bit/interlaced PNG, CICP/ICC/gamma/chromaticity, Exif, animation, perspective/tiling and host-specific affine equivalence are not claimed. A Linux/Windows/macOS CI matrix runs the profile, but the cross-platform claim remains withheld until its hosted artifacts pass. JPEG, WebP, AVIF, video and SVG follow as separate profiles. Freezing a frame or tracing a screenshot crop is a derived approximation, not recovery of the original asset. Generative upscaling/inpainting requires an explicit user policy and cannot silently become canonical source evidence.
Fonts
Exact typography depends on exact font bytes, face/collection index, variation axes, features, coverage, shaping inputs and renderer parameters. Packaging also depends on redistribution policy.
The proposed policy states are portable, private_authoring, linked,
substituted and unavailable. OpenType fsType is preserved as machine-
readable evidence, including restricted/preview/editable/no-subsetting/bitmap
flags, but is not treated as a complete legal license decision.
The executable nuif-opentype-static-single-0 baseline accepts only one
canonically packed, checksummed TrueType-outline sfnt face at index zero.
Skrifa 0.46.2 supplies package-facing metadata after NUIF validates the
directory, ranges, packing and checksums and directly checks required sfnt and
OS/2 fields. A committed hb-info 14.4.0 capture independently checks Ahem
metrics, family, tables and Unicode coverage. Exact bytes, family names,
coverage, fsType, license expression and explicit embedding review must
agree. Package encode/decode and caller-resolved linked bytes run the same
validation. Four static TrueType fixtures are accepted, while six package
trials distinguish portable, private-authoring, linked, substituted and
unavailable outcomes. Each accepted inspection and packaged-font validation is
also measured after warmup against a 4 MiB allocator-traffic and 2 MiB retained
reference ceiling; these are implementation regressions, not format semantics.
Six additional trials retain requested identity separately from a stable font
asset, render with an available declared replacement as approximated, and
emit no text command with item-level unsupported fidelity when replacement
bytes or the font are unavailable.
This is intentionally not general OpenType support. TTC, CFF/CFF2, variable,
color, bitmap, SVG and WOFF/WOFF2 sources, historic ambiguous permission
combinations, subsetting, cluster-level fallback, arbitrary packaged-font
shaping and cross-platform raster behavior remain separate fixtures and
profiles. The configured three-OS parser/package matrix does not establish
cross-platform raster behavior. Parser acceptance and fsType do not grant
redistribution rights.
Browser capture can identify platform fonts used for a node and capture downloaded web-font response bodies. It generally cannot retrieve arbitrary local font bytes. A family/PostScript name is therefore never exact resource identity. Missing bytes produce a link, substitution or unavailable fidelity record instead of a false portable-font claim.
Source-backed browser capture
Static Tree-sitter source synchronization and live browser capture solve different problems. The former preserves source spans for a bounded authored subset. The latter runs a pinned browser to observe actual cascade, layout, fonts, resource responses, accessibility and pixels. They should correlate through provenance, not become one oversized adapter.
The first browser-capture profile records browser/protocol build, OS, viewport, DPR, page scale, locale, timezone, color/reduced-motion preferences, font environment, scroll/pseudo state, navigation identity, readiness/network policy and animation freeze. It collects:
- original HTML/CSS and stylesheet text where accessible;
- DOM snapshots including available frame/template/shadow content;
- boxes, inline text boxes, paint order and a bounded style set;
- downloaded image/font/style response bodies and hashes;
- platform-font usage and font readiness;
- accessibility tree;
- reference screenshots with exact parameters.
Canvas, WebGL, video and worklets are bounded observation surfaces; a frame can be preserved without pretending its generating program was reconstructed. Cookies, authorization headers, credentials, storage and secret form values are not exported. Scripts remain inert.
Multiple viewports and states are more valuable than one oversized capture: they constrain layout hypotheses and permit held-out responsive evaluation.
The automated nuif-cdp-live-0 segment now implements that boundary for one
loopback fixture and exact Chrome for Testing 152.0.7977.64. It starts fresh
temporary profiles, retains a structured runtime context, waits for the exact
navigation loader and declared freeze/readiness point, captures bounded
DOM/layout/background/font/accessibility/resource/PNG evidence, and replaces
opaque browser node IDs with deterministic preorder identities. Four runs at
360, 768, held-out 900 and repeated 360 px retain exactly the expected five
response bodies and repeat the narrow capture bytes. Five exercised
query/cookie/storage/authorization/header canaries are absent from serializable
capture, observations, proposals and package bytes. The two fitted viewports
beat the one-viewport freeform baseline on the held-out fixture.
The separate bounded nuif-layout-inference-0 artifact ranks row stack,
column stack, Grid, linear constraint and fixed freeform candidates using only
the 360/768 px observations. It then evaluates the untouched 900 px holdout,
where the selected constraint records 0.0626 normalized error versus 0.2918
for freeform. All alternatives and exact geometry observation identities are
retained; confidence is raw and uncalibrated, and the result remains
inferred. The trial tests a mechanism on one fixture, not general accuracy or
recovery of original authored intent.
This is a falsifiable local baseline, not the entire profile described above. Cross-browser/OS reproduction, opaque frames and response bodies, full matched-style/source correlation, canvas/video frame capture, authenticated sites and licensed real-page evaluation remain open. WebDriver BiDi is the standards-track transport to revisit as its implemented evidence surface grows; Playwright is the higher-level candidate when NUIF owns a real multi-engine matrix and can make one tool the browser-version authority.
Screenshot reconstruction
A screenshot supplies visible samples but not the unique scene graph or layout program. The recommended pipeline is:
screenshots + contexts
-> OCR and baselines
-> deterministic regions, colors, edges, repetitions and asset candidates
-> optional replaceable UI grounding
-> typed observation graph with confidence and evidence regions
-> replaceable reasoner proposes hierarchy/layout and NUIF operations
-> core validates and applies atomically
-> deterministic layout/render
-> text/structure/geometry/resource/visual differences
-> bounded corrective operations
The model emits typed operations, not an unconstrained full document or code to execute. Invalid and stale transactions fail without partial state. High- resolution full views, overlapping tiles and semantic crops share explicit coordinate transforms; duplicate or conflicting observations remain visible.
The result contains a valid document or no-result, accepted operation log, observations, derived resources, item fidelity, alternatives/abstentions, evaluation report and exact pipeline artifact identities.
Evaluation before training
The benchmark has separate synthetic-exact, licensed real screenshot and source-backed suites. Synthetic NUIF rendering provides exact entities, properties, operations and resources. Real images need human-reviewed visible targets and must preserve ambiguity. Source-backed cases evaluate retained bytes and observations unavailable to the screenshot-only route.
Required metrics include:
- valid operation/document rate;
- OCR region recall, character/word error and baselines;
- element precision/recall and hierarchy error;
- property/geometry accuracy;
- held-out viewport behavior;
- exact resource digest only when bytes exist;
- provenance/fidelity honesty;
- accessibility evidence where justified;
- raw pixels, FLIP, SSIM and pinned LPIPS diagnostics;
- calibrated confidence, abstention and risk/coverage;
- latency, peak RAM/VRAM, iterations and cost.
No pixel score is sufficient. A page-sized screenshot can be visually perfect and semantically useless. Structural/text/resource/edit-task metrics prevent that reward shortcut. Dataset splits group by origin, template, component, font, resource and generator; near duplicates cannot cross splits.
The executable nuif-reconstruction-corpus-manifest-0 turns that rule into a
bounded audit. It pins the data snapshot, dataset card, evaluator and every
input/target by digest; records public/restricted/withheld disclosure and
evaluation/calibration/adaptation/redistribution permission independently; and rejects
exact artifact or declared family reuse across adaptation, calibration,
validation and test. Private/authenticated records also require explicit
authorization and a withdrawal-policy artifact. This is declaration integrity,
not automated legal review or duplicate discovery; real records and their group
assignments still need independent human/tool review.
The ablation ladder is deterministic OCR/CV, one-shot reasoner, observation- assisted reasoner, hierarchical crops, multi-viewport ranking, correction loop, then any tuned or distilled student. Every addition uses the same frozen holdout and budget.
Adaptation and distillation
Training is justified only after the untuned loop and error taxonomy are reproducible, rights-cleared traces exist, and the remaining errors appear learnable. Training examples contain input hashes, observation versions, proposals, diagnostics, accepted operations, intermediate renders/differences and final package/fidelity reports. Positive sequence targets are validated accepted transitions, not raw model transcripts.
Compare prompt/schema/tool improvements and retrieval before fine-tuning. If adaptation remains justified, compare ordinary supervised tuning, low-rank adaptation and quantized low-rank adaptation under equal data and evaluation. Quantized adaptation is a memory technique, not an accuracy claim.
Sequence-level distillation may train a smaller student from the best evaluated teacher pipeline. The teacher is a measured system of tools plus a model, not a provider name. Distillation transfers errors too, so render validation and held-out evaluation remain mandatory.
Models, processors, adapters and datasets are separately versioned optional
artifacts with digests, model cards, dataset datasheets, license lineage and
training manifests. They never redefine nuif-core or travel as ordinary
document resources.
The executable provider boundary uses a deliberately small canonical wrapper, not a new AI bill-of-materials vocabulary. It binds NUIF capabilities, execution modes and observation/proposal profiles to exact implementation, model, processor, adapter, quantization, prompt and tool artifacts. Observation bundles carry the complete manifest registry, so a digest cannot dangle and a proposal cannot substitute an unpublished provider before mutation. Released or learned providers point to content-addressed SPDX 3.0.1 or CycloneDX 1.7 inventory; learned providers also point to a model card. This complements runtime packaging such as MLflow or ONNX external data without making either a required NUIF dependency.
Private/authenticated captures default to local processing, no retention and no training. Remote transfer, telemetry, retention and training are independent consent/policy decisions.
Maturity boundary
The current 0.1.0-alpha.3 label belongs to the developer editor application.
It provides no evidence that the broad image/font resource, portable browser
capture or screenshot reconstruction accuracy profiles are complete. A
deterministic package, narrow PNG/static-font segments, fixed provider-input
contracts and one pinned local live-browser segment are implemented, but their
deliberately narrow evidence does not promote the broader profiles.
Promotion requires the package/resource cross-writer fixtures, pinned capture reproduction, baseline/closed-loop/calibration harness, leak-resistant licensed evaluation data, independent result reproduction and at least one real edit workflow that benefits from the inferred semantics. Until then the work is research and proposed specification text, not a standard or production reconstruction promise.
Primary research records
nuif:research:resource-packaging-and-source-capture-synthesisnuif:research:model-agnostic-screenshot-reconstruction-and-trainingnuif:research:provider-artifact-manifests-and-ai-bomsnuif:research:epub-ocf-package-containernuif:research:oci-resource-descriptorsnuif:research:opentype-font-embedding-and-portabilitynuif:research:ttf-parsernuif:research:fontationsnuif:research:chromium-source-backed-ui-capturenuif:research:live-chromium-cdp-capturenuif:research:design2code-real-world-benchmarknuif:research:pix2struct-screenshot-parsing-pretrainingnuif:research:screenai-ui-annotationnuif:research:confidence-calibration-and-selective-predictionnuif:research:lora-low-rank-adaptationnuif:research:qlora-quantized-adaptationnuif:research:sequence-level-knowledge-distillation