SemanticDiff
On this page

SemanticDiff

Interface in Tooling

The four buckets of difference.

import type { SemanticDiff } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

interface SemanticDiff {
readonly interface: readonly string[];
readonly resources: readonly string[];
readonly constants: readonly string[];
readonly controlFlow: readonly string[];
}

Description

Each entry is a fact line prefixed - (present in a, absent from b) or + (the reverse). When all four are empty the modules agree on everything this comparison inspects; isSemanticallyEqual performs that test.

Instance properties

interfaceread only readonly string[]

Entry-point signatures and the vertex attribute layout.

resourcesread only readonly string[]

Bind groups, std140/std430 struct layouts, and required capabilities.

constantsread only readonly string[]

Module consts, pipeline overrides, and the multiset of numeric literals in function bodies. A literal’s value is reported here and nowhere else, because the control-flow skeleton leaves it out, so changing a constant and changing the shape of the code around it land in different buckets.

controlFlowread only readonly string[]

Per-statement control-flow skeleton, one line per statement, addressed by path.

See also

Source

src/core/semantic-diff.ts, line 81, at commit 26de7be8

Edit this page Report a problem