README

Milky2018/svgdiff/engine/model does not have a README file

#
AlignmentEvidence

pub(all) struct AlignmentEvidence {
score_kind : String
selected_score : Double?
candidate_count : Int
equal_score_candidate_count : Int
ambiguity : String
confidence : Double?
confidence_status : String
}

Reviewable selection evidence for one Subject Alignment.

confidence remains null while confidence_status is not_calibrated; deterministic selection does not imply a calibrated probability.

#
AtomicDifference

pub(all) struct AtomicDifference {
id : String
subject_role : String
subject_alignment_id : String?
domain : String
source_before : String
source_after : String
source_fact_before : DeclaredVisualFact?
source_fact_after : DeclaredVisualFact?
changed_fact_ids : Array[String]
evidence_layers : Array[String]
computed_relation : ComputedRelation
parameter_delta_css_px : Double?
presence_magnitude : PresenceMagnitude?
magnitude : DifferenceMagnitude
domain_ordering : DomainOrdering
}

Smallest independently reportable visual-semantic change.

Domain, evidence layers, computed relation, magnitude, and ordering remain independent so representation and measured visual impact are not conflated.

#
CanvasOutcome

pub(all) struct CanvasOutcome {
status : String
reason_code : String?
magnitude : RenderedMagnitude?
perceptual_flip : CanvasPerceptualFlipEvidence
} derive(ToJson)

Measurements computed once from the final before and after canvases.

#
CanvasPerceptualFlipEvidence

pub(all) struct CanvasPerceptualFlipEvidence {
status : String
reason_code : String?
method_id : String?
canvas_mean : Double?
} derive(ToJson)

Availability and comparison-wide LDR-FLIP mean.

#
CauseEnvelope

pub(all) struct CauseEnvelope {
guarantee : String
coverage : String
fallback_scope : String
candidate_changed_fact_ids : Array[String]
diagnostic_ids : Array[String]
} derive(ToJson)

Conservative Changed Fact candidates for one Difference Region.

A sound_overapproximation contains every actual changed cause within complete analysis coverage, but may contain false positives.

#
ChangedFact

pub(all) struct ChangedFact {
id : String
subject_id : String
property : String
before : DeclaredVisualFact?
after : DeclaredVisualFact?
affected_subject_ids : Array[String]
}

One changed supported authored fact and the subjects it may affect.

#
ComparisonProfile

pub(all) struct ComparisonProfile {
viewport_width : Int
viewport_height : Int
comparison_dpr : Double
color_interpretation : String
raster_representation : String
renderer_id : String
renderer_conformance_profile_id : String
perceptual_background : PerceptualBackground?
flip_viewing_conditions : FlipViewingConditions?
flip_error_threshold : FlipErrorThreshold?
}

Rendering and normalization conditions recorded for one comparison.

The root schema 2.0 API accepts caller-provided viewport dimensions, Perceptual Background, FLIP Viewing Conditions, and FLIP error threshold, and canonicalizes the remaining fields to v1_default.

#
ComparisonProfile::v1_default

Return the fixed schema 2.0 profile with a 16 x 16 viewport.

Callers may copy the record with different positive viewport dimensions, an explicitly parsed Perceptual Background, invariant-checked FLIP Viewing Conditions, or an invariant-checked FLIP error threshold.

#
ComputedRelation

pub(all) struct ComputedRelation {
status : String
reason_code : String
missing_side : String?
diagnostic_ids : Array[String]
} derive(ToJson)

Relationship between the supported before and after computed facts.

status is equivalent, different, indeterminate, or not_applicable; reason_code and Diagnostic references explain why.

#
DeclaredVisualFact

pub(all) struct DeclaredVisualFact {
property : String
authored_value : String
declared_value : String
origin : String
source_span : ReportSourceSpan
} derive(ToJson)

One supported authored visual declaration with exact source provenance.

#
Diagnostic

pub(all) struct Diagnostic {
id : String
code : String
subject_id : String
affected_evidence_layers : Array[String]
source_locations : Array[DiagnosticSourceLocation]
} derive(ToJson)

Structured coverage limitation or analysis failure.

#
DiagnosticSourceLocation

pub(all) struct DiagnosticSourceLocation {
source_role : String
source_span : ReportSourceSpan
} derive(ToJson)

One source-qualified location establishing a Diagnostic.

#
DifferenceMagnitude

pub(all) struct DifferenceMagnitude {
parameter_abs_user_units : Double?
parameter_signed_user_units : Double?
symmetric_relative : Double?
parameter_abs_css_px : Double?
parameter_viewport_fraction : Double?
parameter_entity_fraction : Double?
geometry_displacement_css_px : Double?
painted_boundary_displacement : PaintedBoundaryDisplacementMagnitude?
painted_coverage_difference : PaintedCoverageDifferenceMagnitude?
geometry_viewport_fraction : Double?
presence_painted_viewport_fraction : Double?
raster_changed_pixel_fraction : Double?
raster_rgba8_rmse : Double?
raster_linear_premultiplied_rgba_rmse : Double?
intrinsic_raster : IntrinsicRasterMagnitude?
transform_effect : TransformEffectMagnitude?
}

Domain-appropriate magnitude vector for one Atomic Difference.

Optional components that were not computed serialize as null rather than zero.

#
DifferenceRegion

pub(all) struct DifferenceRegion {
id : String
source : String
pixel_x : Int
pixel_y : Int
pixel_width : Int
pixel_height : Int
css_x : Double
css_y : Double
css_width : Double
css_height : Double
changed_pixels : Int
viewport_fraction : Double
cause_envelope : CauseEnvelope
} derive(ToJson)

Pixel-space and CSS-space localization of one visual outcome component.

#
DomainOrdering

pub(all) struct DomainOrdering {
policy_id : String
components : Array[Double]
} derive(ToJson)

Versioned lexicographic components for ordering differences in one domain.

#
FeatureCoverage

pub(all) struct FeatureCoverage {
feature_id : String
subject_id : String
source_semantics : String
computed_appearance : String
rendered_evidence : String
diagnostic_ids : Array[String]
} derive(ToJson)

Coverage of one encountered feature at each canonical evidence layer.

Layer status is covered, limited, not_applicable, or failed. Diagnostics explain every limited or failed row.

#
FlipErrorThreshold

pub struct FlipErrorThreshold {
value : Double
} derive(Eq, ToJson)

Explicit optional reporting threshold for LDR-FLIP error values.

#
FlipErrorThreshold::from_value

fn FlipErrorThreshold::from_value(value : Double) -> FlipErrorThreshold?

Construct one finite FLIP reporting threshold in the metric's [0, 1] range.

#
FlipErrorThreshold::value

fn FlipErrorThreshold::value(self : FlipErrorThreshold) -> Double

#
FlipViewingConditions

pub struct FlipViewingConditions {
pixels_per_degree : Double
} derive(Eq, ToJson)

Explicit LDR-FLIP viewing conditions with a bounded filter domain.

#
FlipViewingConditions::from_pixels_per_degree

fn FlipViewingConditions::from_pixels_per_degree(pixels_per_degree : Double) -> FlipViewingConditions?

Construct supported LDR-FLIP viewing conditions.

#
FlipViewingConditions::pixels_per_degree

fn FlipViewingConditions::pixels_per_degree(self : FlipViewingConditions) -> Double

#
ImpactAssessment

pub(all) struct ImpactAssessment {
policy_id : String
status : String
calibration_status : String
input_fields : Array[String]
candidate_event_count : Int
frontier_relation : String
frontier_groups : Array[ImpactFrontierGroup]
domination_witnesses : Array[ImpactDominationWitness]
} derive(Eq, ToJson)

Additive versioned main-event assessment that preserves partial ordering.

#
ImpactDominationWitness

pub(all) struct ImpactDominationWitness {
dominant_event_id : String
dominated_event_id : String
rule_id : String
} derive(Eq, ToJson)

One deterministic explanation for excluding a dominated event.

#
ImpactFrontierGroup

pub(all) struct ImpactFrontierGroup {
event_ids : Array[String]
atomic_difference_ids : Array[String]
measurements : ImpactMeasurement?
} derive(Eq)

One singleton or exact measured-tie group on the main-event frontier.

#
ImpactMeasurement

pub(all) struct ImpactMeasurement {
changed_pixel_fraction : Double
linear_premultiplied_rgba_rmse : Double
} derive(Eq, ToJson)

Common whole-canvas event measurements used by one Impact Assessment.

#
IntrinsicRasterMagnitude

pub(all) struct IntrinsicRasterMagnitude {
before_width : Int
before_height : Int
after_width : Int
after_height : Int
compared_pixels : Int?
changed_pixels : Int?
changed_pixel_fraction : Double?
rgba8_rmse : Double?
linear_premultiplied_rgba_rmse : Double?
} derive(ToJson)

Intrinsic decoded-raster comparison, independent of final SVG compositing.

#
PaintedBoundaryDisplacementMagnitude

pub(all) struct PaintedBoundaryDisplacementMagnitude {
method_id : String
before_sample_count : Int
after_sample_count : Int
mean_css_px : Double
p95_css_px : Double
max_css_px : Double
} derive(Eq, ToJson)

Symmetric nearest-boundary statistics from the pinned renderer's alpha support.

#
PaintedCoverageDifferenceMagnitude

pub(all) struct PaintedCoverageDifferenceMagnitude {
method_id : String
before_coverage_css_px2 : Double
after_coverage_css_px2 : Double
absolute_difference_css_px2 : Double
union_coverage_css_px2 : Double
fraction : Double
} derive(Eq, ToJson)

Symmetric alpha-only isolated painted-coverage comparison.

#
PerceptualBackground

pub struct PerceptualBackground {
red : Int
green : Int
blue : Int
} derive(Eq, ToJson)

One explicit opaque sRGB8 background for future perceptual compositing.

#
PerceptualBackground::blue

#
PerceptualBackground::green

#
PerceptualBackground::parse_srgb

fn PerceptualBackground::parse_srgb(source : String) -> PerceptualBackground?

Parse one deterministic opaque sRGB color for perceptual compositing.

#
PerceptualBackground::red

#
PerceptualColorEvidence

pub(all) struct PerceptualColorEvidence {
status : String
reason_code : String?
magnitude : PerceptualColorMagnitude?
} derive(Eq, ToJson)

Availability and optional event-local perceptual-color magnitude.

#
PerceptualColorMagnitude

pub(all) struct PerceptualColorMagnitude {
method_id : String
sample_count : Int
mean_delta_e_ok : Double
} derive(Eq, ToJson)

Displayed-color magnitude for one selected rendered outcome after explicit background compositing.

#
PerceptualFlipAreaAboveThreshold

pub(all) struct PerceptualFlipAreaAboveThreshold {
threshold : Double
pixel_count : Int
canvas_fraction : Double
} derive(Eq, ToJson)

Explicit-threshold spatial extent for one event-local LDR-FLIP response.

#
PerceptualFlipEvidence

pub(all) struct PerceptualFlipEvidence {
status : String
reason_code : String?
map : PerceptualFlipMap?
statistics : PerceptualFlipStatistics?
} derive(Eq, ToJson)

Availability and optional event-local LDR-FLIP map.

#
PerceptualFlipMap

pub(all) struct PerceptualFlipMap {
method_id : String
pixel_x : Int
pixel_y : Int
pixel_width : Int
pixel_height : Int
encoding : String
quantization_step : Double
values_base64 : String
} derive(Eq, ToJson)

Deterministic quantized LDR-FLIP map for one selected rendered outcome.

#
PerceptualFlipStatistics

pub(all) struct PerceptualFlipStatistics {
method_id : String
canvas_pixel_count : Int
event_region_sample_count : Int
response_sample_count : Int
canvas_mean : Double
event_region_mean : Double
response_p95 : Double
response_maximum : Double
area_above_threshold : PerceptualFlipAreaAboveThreshold?
} derive(Eq)

Separate pooled domains over one unquantized LDR-FLIP map.

#
PresenceMagnitude

pub(all) struct PresenceMagnitude {
affected_entity_count : Int
bounds_area_css_px2 : Double
bounds_viewport_fraction : Double
painted_area_css_px2 : Double
painted_viewport_fraction : Double
} derive(ToJson)

Numeric footprint of inserted or deleted visual subjects.

#
RenderedEvidence

pub(all) struct RenderedEvidence {
status : String
reason_code : String?
magnitude : RenderedMagnitude?
perceptual_color : PerceptualColorEvidence
perceptual_flip : PerceptualFlipEvidence
} derive(ToJson)

Availability and optional magnitude of canonical rendered evidence.

A computed zero magnitude is distinct from not_computed.

#
RenderedMagnitude

pub(all) struct RenderedMagnitude {
changed_pixels : Int
changed_pixel_fraction : Double
rgba8_rmse : Double
linear_premultiplied_rgba_rmse : Double
} derive(ToJson)

Continuous canonical raster measurements for one rendered outcome.

#
RendererCapabilityGap

pub(all) struct RendererCapabilityGap {
capability_id : String
support_status : String
diagnostic_ids : Array[String]
} derive(ToJson)

One renderer capability gap encountered by the current comparison.

support_status is guarded or unavailable. Diagnostic references remain the authority for affected subjects and evidence layers.

#
ReportSourceSpan

pub(all) struct ReportSourceSpan {
start_offset : Int
end_offset : Int
} derive(ToJson)

Half-open UTF-16 offsets into the original SVG source.

#
ResolvedVisualFact

pub(all) struct ResolvedVisualFact {
subject_id : String
property : String
resolved_value : String
resolution : String
declaration_owner_id : String?
declaration : DeclaredVisualFact?
inheritance_depth : Int
} derive(ToJson)

One supported visual fact after declaration precedence and inheritance.

#
SourceResolutionPair

pub(all) struct SourceResolutionPair {
subject_id : String
property : String
before : ResolvedVisualFact?
after : ResolvedVisualFact?
} derive(ToJson)

Before and after resolved facts for one subject property.

#
StructuredReport

pub(all) struct StructuredReport {
schema_version : String
analysis_status : String
canvas_outcome : CanvasOutcome
impact_assessment : ImpactAssessment
coverage_matrix : Array[FeatureCoverage]
renderer_capability_gaps : Array[RendererCapabilityGap]
profile : ComparisonProfile
subject_alignments : Array[SubjectAlignment]
changed_facts : Array[ChangedFact]
source_resolutions : Array[SourceResolutionPair]
atomic_differences : Array[AtomicDifference]
events : Array[VisualEvent]
diagnostics : Array[Diagnostic]
}

Complete schema 2.0 result of one SVG comparison.

Read analysis_status and diagnostics before interpreting an empty atomic_differences array as profile-scoped equality.

#
StructuredReport::to_agent_projection_json_lines

fn StructuredReport::to_agent_projection_json_lines(self : StructuredReport) -> String

Serialize the concise report as line-addressable JSONL records.

#
StructuredReport::to_compact_json_string

fn StructuredReport::to_compact_json_string(self : StructuredReport) -> String

Serialize this report as whitespace-free schema 2.0 JSON.

This serialization contains the same fields and evidence as to_json_string; it only removes presentation whitespace.

#
StructuredReport::to_json_string

fn StructuredReport::to_json_string(self : StructuredReport) -> String

Serialize this report as indented schema 2.0 JSON.

#
SubjectAlignment

pub(all) struct SubjectAlignment {
id : String
subject_role : String
relation : String
before : Array[SubjectReference]
after : Array[SubjectReference]
basis : String
evidence : AlignmentEvidence
} derive(ToJson)

Set-to-set relationship between before and after visual subjects.

#
SubjectInstanceContext

pub(all) struct SubjectInstanceContext {
instance_id : String
definition_subject_id : String
use_path : Array[String]
} derive(ToJson)

Placement identity for a subject rendered through one or more use hosts.

The corresponding authored definition keeps its own identity and Source Spans; instance_id identifies only this rendered outcome.

#
SubjectReference

pub(all) struct SubjectReference {
source_index : Int
kind : String
authored_id : String?
instance_context : SubjectInstanceContext?
}

Report-local reference to one visual subject in an input SVG.

#
TransformEffectMagnitude

pub(all) enum TransformEffectMagnitude {
TranslationEffect(TransformTranslationMagnitude)
RotationEffect(TransformRotationMagnitude)
ScaleEffect(TransformScaleMagnitude)
SkewEffect(TransformSkewMagnitude)
ResidualMatrixEffect(TransformResidualMagnitude)
}

Tagged raw magnitude for one canonical transform-effect domain.

#
TransformResidualMagnitude

pub(all) struct TransformResidualMagnitude {
before_matrix : Array[Double]
after_matrix : Array[Double]
before_determinant : Double
after_determinant : Double
} derive(ToJson)

Exact singular linear transforms retained without a coefficient score.

#
TransformRotationMagnitude

pub(all) struct TransformRotationMagnitude {
before_degrees : Double
after_degrees : Double
signed_delta_degrees : Double
abs_delta_degrees : Double
} derive(ToJson)

Canonical paired rotation values and shortest signed angular change.

#
TransformScaleMagnitude

pub(all) struct TransformScaleMagnitude {
before_x : Double
before_y : Double
after_x : Double
after_y : Double
max_abs_delta : Double
} derive(ToJson)

Canonical signed axis scales and their largest absolute paired delta.

#
TransformSkewMagnitude

pub(all) struct TransformSkewMagnitude {
before_degrees : Double
after_degrees : Double
signed_delta_degrees : Double
abs_delta_degrees : Double
} derive(ToJson)

Canonical paired X-skew values and shortest signed angular change.

#
TransformTranslationMagnitude

pub(all) struct TransformTranslationMagnitude {
before_x_css_px : Double
before_y_css_px : Double
after_x_css_px : Double
after_y_css_px : Double
delta_x_css_px : Double
delta_y_css_px : Double
norm_css_px : Double
} derive(ToJson)

Viewport-space translation change and its Euclidean CSS-pixel magnitude.

#
VisualEvent

pub(all) struct VisualEvent {
id : String
primary_subject_id : String
atomic_difference_ids : Array[String]
rendered_outcome : RenderedEvidence
difference_regions : Array[DifferenceRegion]
} derive(ToJson)

Agent-facing grouping of Atomic Differences around one subject outcome.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io