COMPO · 5.01 · OCCUPIED MASK / FREE-SPACE MASK

Occupied
mask /
free-space.

Scene-domain support union и его геометрический complement: concrete OccupiedMask/FreeMask, occupied/free areas и fractions. 5.01 работает только внутри explicit CompositionSpaceDomain и explicit SpaceMaskPolicy, не смешивая scene occupancy с hullOccupancy темы 4, visual mass или grid occupancy.

ModuleCompo 5.01
Scopeoccupied / free masks
Ownsscene area + fractions
Regionsdeferred 5.02
Topic5 · SPACE
Next5.02

Scene masks становятся реальными

00 / module api

5.01 превращает shell 5.00 в конкретную пару occupied/free masks и измеряет только scene-domain geometry.

SCOPE

Support union, occupied mask, domain complement, occupied/free areas и fractions.

INPUT

Explicit domain + mask policy + explicit support-set state.

FINALITY

SCENE OCCUPIED / FREE MASK GEOMETRY ONLY.

UNION, NOT SUM. Два перекрывающихся объекта занимают union area, а не сумму собственных площадей.

SpaceMaskPolicy

01 / mask policy

Policy превращает сложные render semantics в однозначный вопрос: какая часть domain считается бинарно occupied.

Policy

SpaceMaskPolicy {
  policyRef,

  supportMode:
    GEOMETRIC_PAINT_SUPPORT |
    VISIBLE_PAINT_SUPPORT |
    CUSTOM_RENDER_SUPPORT,

  alphaMode:
    ANY_NONZERO |
    THRESHOLD |
    CUSTOM,

  alphaThreshold?,

  includeOutlines,
  includeMasks,
  includeDecorativeObjects,

  occlusionMode,
  boundaryRule,
  provenance
}

Binary topology

alpha / visibility
  ↓ explicit policy
binary object support
  ↓ clip to domain
boolean union
  ↓
OccupiedMask
  ↓ domain complement
FreeMask
ALPHA IS NOT MASS HERE. 5.01 может использовать alpha только как criterion включения в binary support. Alpha-weighted magnitude остаётся Topic 4.

ObjectSupportRef

02 / object support

5.01 не пересобирает contour geometry. Он потребляет уже resolved object/render support.

ObjectSupportRef {
  objectRef,
  supportRef,
  coordinateSpaceRef,

  supportMode,
  visibilityRef?,
  alphaSupportRef?,
  clipRef?,

  status,
  confidence,
  provenance
}

Topic 3

Geometry / fill / outline / transform.

Render adapter

Visibility, masks, alpha support if policy needs them.

5.01

Clip + binary union + complement only.

Mask construction

03 / construction pipeline

Порядок операций фиксирован, потому что clip/union/complement нельзя переставлять произвольно.

validate Domain ↓ validate SpaceMaskPolicy ↓ resolve explicit support-set state ↓ adapt each support to domain coordinates ↓ resolve binary support under alpha/visibility policy ↓ clip support_i to Domain ↓ OccupiedMask = UNION(clipped support_i) ↓ FreeMask = Domain \ OccupiedMask ↓ measure both masks ↓ emit exactness / confidence / error

Representation contract

04 / vector + raster

Production может быть vector или raster, но semantics должны совпадать.

RepresentationUseRequirements
VECTOR_REGIONточные/контролируемые boolean regionsrobust union/difference, explicit tolerance
RASTER_BINARYrender-derived/custom support fallbackdeterministic cell/sample rule, binary after policy
HYBRIDmixed source adaptersconversion provenance + bounded error
ANTIALIAS ≠ PARTIAL FREE SPACE. Серые edge pixels рендера не означают автоматически «30% свободно». Сначала explicit alpha policy решает binary support membership.

Occupied + free = domain

05 / invariants

Главный invariant темы 5 начинается здесь.

O = OccupiedMask F = FreeMask D = CompositionSpaceDomain F = D \ O O ∪ F = D interior(O) ∩ interior(F) = ∅ Area identity: area(O) + area(F) = area(D) ± tolerance Fraction identity: occupiedFraction + freeFraction = 1 ± tolerance
SAME DOMAIN / SAME POLICY. Любое нарушение этой пары делает complement relation неканонической.

Occupied/free metrics

06 / area descriptors

5.01 владеет scene-domain area descriptors, но не делает из них score.

Areas

occupiedAreaPx2 = measure(O) freeAreaPx2 = measure(F) domainAreaPx2 = measure(D)

Fractions

occupiedFraction = area(O) / area(D) freeFraction = area(F) / area(D) 0..1 when valid
COMPLEMENT FAMILY. occupied/free area и fraction — алгебраически связанные descriptors. 5.04 не должен дать им четыре независимых голоса.

Не путать с 4.01 и Topic 8

07 / namespace firewall

Denominator определяет смысл метрики.

MetricDenominatorOwner
visualMass.geometry.hullOccupancyobject convex hull4.01
space.mask.occupiedFractionCompositionSpaceDomain5.01
space.mask.freeFractionCompositionSpaceDomain5.01
grid occupancygrid registry/cellsTopic 8

Alpha и visibility

08 / alpha + occlusion

Mask semantics обязаны быть explicit — особенно для полупрозрачных и перекрытых объектов.

ANY_NONZERO

Support exists

α выше owner epsilon → occupied. Magnitude α не влияет на area.

THRESHOLD

Explicit cutoff

α ≥ declared threshold → occupied. Threshold имеет provenance.

VISIBLE_ONLY

Resolved visibility

Требует occlusion/render adapter; 5.01 сам z-compositing не изобретает.

GEOMETRIC SUPPORT. При обычном union перекрытие объектов не удваивает occupied area. Visibility ordering нужен только когда policy действительно требует visible-only/custom render support.

Empty, full, missing

09 / edge cases

Нули валидны только когда причина известна.

CaseOccupiedFreeStatus
explicit empty included support set0100%valid
domain fully covered100%0valid
support set missing/not loadedN/AN/Apartial/N_A
all support refs N/AN/AN/Apartial/N_A
zero-area/invalid domainN/AN/Ainvalid
object fully outside domainno contributionunchangedvalid after clip
MISSING ≠ EMPTY. Отсутствующий список supports нельзя интерпретировать как пустую сцену.

Exactness + confidence

10 / exactness

Free-space topology downstream зависит от качества mask, поэтому approximation metadata обязательна.

SpaceMaskPairResult {
  domainRef,
  policyRef,

  occupiedMask,
  freeMask,

  domainAreaPx2,
  occupiedAreaPx2,
  freeAreaPx2,
  occupiedFraction,
  freeFraction,

  exactness,
  approximationErrorBoundPx2?,
  confidence,
  status,
  provenance
}
confidence = evidence / geometry quality NOT: occupiedFraction freeFraction aesthetic certainty

Correction routing

11 / correction requests

Mask engine не двигает объекты ради нужной пустоты.

Domain

→ canvas/domain owner.

Object support

→ Topic3/render adapter.

Visibility

→ render/occlusion owner.

Whitespace target

→ 5.04 / future solver.

NO FOREIGN MUTATION. `freeFraction too low` не даёт 5.01 права уменьшить shape, удалить decoration или изменить opacity.

Visual Lab

12 / visual lab

Union, complement и policy differences показаны без оценки качества.

A · OBJECT SUPPORTS overlap exists between objects B · UNION = OCCUPIED MASK overlap counted once C · DOMAIN \ OCCUPIED cyan = free-space mask D · VALID EXTREMES explicit empty set occupied=0 · free=1 full coverage occupied=1 · free=0 missing support set occupied=N/A · free=N/A never reinterpret as empty scene occupiedFraction + freeFraction = 1 · descriptors only · no whitespace verdict

Reference mask tests

13 / deterministic tests

Reference runner использует deterministic binary-grid masks для проверки именно algebra/ownership semantics, не навязывая production raster backend.

Tests not run yet.

DATA FOR LAYOUT ENGINE

14 / machine contract

Machine-readable contract 5.01.

{
  "module": "Compo 5.01",
  "name": "occupied_mask_and_free_space_mask",
  "version": "1.1-corrective",
  "scope": "SCENE_DOMAIN_SUPPORT_UNION_BINARY_OCCUPIED_MASK_AND_FREE_SPACE_COMPLEMENT",
  "consumes": [
    "Compo5.00.CompositionSpaceDomain",
    "Compo5.00.SpaceMaskPolicyRef",
    "ObjectSupportRef[] from Topic3/render adapters",
    "Compo3.05 world-to-domain transform adapter?",
    "Clip/Crop domain adapter?",
    "Visibility/Occlusion adapter? when VISIBLE_PAINT_SUPPORT is requested",
    "Intrinsic alpha/support evidence from paint/render owner? according mask policy"
  ],
  "provides": [
    "SpaceMaskPolicy",
    "ObjectSupportSet",
    "ObjectSupportRef",
    "SpaceMask",
    "OccupiedMaskResult",
    "FreeSpaceMaskResult",
    "SpaceMaskPairResult",
    "MetricResult[space.mask.occupiedAreaPx2]",
    "MetricResult[space.mask.freeAreaPx2]",
    "MetricResult[space.mask.occupiedFraction]",
    "MetricResult[space.mask.freeFraction]",
    "SpaceMaskCorrectionRequest[]"
  ],
  "owns_metrics": [
    "space.mask.occupiedAreaPx2",
    "space.mask.freeAreaPx2",
    "space.mask.occupiedFraction",
    "space.mask.freeFraction",
    "space.mask.confidence"
  ],
  "descriptors_only": [
    "space.mask.domainAreaPx2",
    "space.mask.representation",
    "space.mask.measurementStage",
    "space.mask.policyRef",
    "space.mask.supportSetHash",
    "space.mask.objectCount",
    "space.mask.exactness",
    "space.mask.approximationErrorBoundPx2",
    "space.mask.status"
  ],
  "space_mask_policy_schema": {
    "policyRef": "string",
    "supportMode": "GEOMETRIC_PAINT_SUPPORT|VISIBLE_PAINT_SUPPORT|CUSTOM_RENDER_SUPPORT",
    "alphaMode": "ANY_NONZERO|THRESHOLD|CUSTOM",
    "alphaThreshold": "required only for THRESHOLD; finite [0,1]",
    "includeOutlines": "boolean",
    "includeMasks": "boolean",
    "includeDecorativeObjects": "boolean or explicit semantic filter adapter",
    "occlusionMode": "IGNORE_FOR_UNION|VISIBLE_ONLY|CUSTOM",
    "boundaryRule": "CLOSED_SUPPORT|CUSTOM",
    "provenance": "STANDARD|STYLE_PRESET|EMPIRICAL|INITIAL_HEURISTIC"
  },
  "object_support_schema": {
    "objectRef": "string",
    "supportRef": "owner-qualified resolved support ref",
    "coordinateSpaceRef": "must be reconcilable with CompositionSpaceDomain",
    "supportMode": "must match/adapt to requested policy",
    "visibilityRef": "optional",
    "alphaSupportRef": "optional according policy",
    "clipRef": "optional",
    "status": "READY|N_A|PARTIAL|INVALID",
    "confidence": "0..1",
    "provenance": "object"
  },
  "space_mask_schema": {
    "maskRef": "string",
    "domainRef": "CompositionSpaceDomain ref",
    "policyRef": "SpaceMaskPolicy ref",
    "kind": "OCCUPIED|FREE",
    "representation": "VECTOR_REGION|RASTER_BINARY|HYBRID",
    "dataRef": "backend-specific immutable data ref",
    "measurementStage": "GEOMETRIC_SUPPORT|VISIBLE_SUPPORT|FREE_SPACE_DERIVED",
    "exactness": "EXACT|BOUNDED_APPROXIMATION",
    "confidence": "0..1",
    "provenance": "object",
    "supportSetRef": "ObjectSupportSet ref"
  },
  "mask_construction": {
    "step_1": "validate domain + policy + explicit support set state",
    "step_2": "adapt each included object support into domain coordinate space",
    "step_3": "resolve alpha/visibility/outline/mask support under SpaceMaskPolicy",
    "step_4": "clip each support to CompositionSpaceDomain",
    "step_5": "boolean union all included supports -> OccupiedMask",
    "step_6": "FreeMask = Domain minus OccupiedMask using same domain/policy",
    "step_7": "measure occupied/free area and fractions from the canonical masks",
    "step_8": "emit exactness/confidence/error/provenance"
  },
  "representation_policy": {
    "preferred": "exact vector boolean region when source supports robust exact/controlled geometry",
    "fallback": "deterministic raster binary mask or bounded polygonal approximation",
    "raster_sampling": "pixel/sample-cell rule must be explicit and deterministic",
    "anti_aliasing": "render antialias coverage is not automatically fractional free space; alphaMode resolves support to binary occupancy first",
    "hybrid": "allowed only when error bounds and conversion provenance are explicit"
  },
  "area_metrics": {
    "domainAreaPx2": "area of supplied CompositionSpaceDomain boundary; diagnostic input/derived helper, not canvas ownership",
    "occupiedAreaPx2": "measure(OccupiedMask)",
    "freeAreaPx2": "measure(FreeMask)",
    "occupiedFraction": "occupiedAreaPx2/domainAreaPx2",
    "freeFraction": "freeAreaPx2/domainAreaPx2",
    "complement_identity": "occupiedAreaPx2 + freeAreaPx2 = domainAreaPx2 within declared tolerance",
    "fraction_identity": "occupiedFraction + freeFraction = 1 within declared tolerance"
  },
  "metric_policy": {
    "occupied/free_area": "geometric scene-space descriptors only",
    "occupied/free_fraction": "scene-domain descriptors only",
    "direct_scoring": "FORBIDDEN in 5.01",
    "more_free_is_better": "FORBIDDEN",
    "more_occupied_is_better": "FORBIDDEN",
    "target_interpretation": "deferred to Compo5.04",
    "components_relation": "freeArea/fraction are algebraic complements of occupiedArea/fraction and must not become independent scoring votes"
  },
  "empty_and_full_semantics": {
    "explicit_empty_support_set": "valid OccupiedMask empty, occupiedArea=0, freeArea=domainArea, freeFraction=1",
    "fully_covered_domain": "valid FreeMask empty, freeArea=0, occupiedFraction=1",
    "missing_support_set": "N_A/PARTIAL according input policy; never treat as explicit empty scene",
    "all_supports_N_A": "N_A/PARTIAL, not empty occupancy",
    "zero_domain_area": "INVALID/N_A, fractions undefined"
  },
  "occlusion_alpha_policy": {
    "GEOMETRIC_PAINT_SUPPORT": "union resolved paint-support geometry; object-to-object occlusion does not subtract occupied union unless explicit policy says visible-only",
    "VISIBLE_PAINT_SUPPORT": "requires visibility/occlusion-resolved support adapter",
    "ANY_NONZERO": "alpha>owner epsilon is occupied support",
    "THRESHOLD": "alpha>=explicit threshold is occupied support",
    "CUSTOM": "requires owner-qualified binary support result",
    "important": "alpha magnitude remains Topic4 mass evidence; 5.01 uses alpha only to decide binary support membership under explicit policy"
  },
  "hard_constraints": [
    "one metric = one owner",
    "OccupiedMask and FreeMask must share the same CompositionSpaceDomain and SpaceMaskPolicy",
    "FreeMask is the complement of OccupiedMask inside the explicit domain",
    "object supports must be boolean-unioned; naive sum of per-object occupied areas is forbidden",
    "support outside the domain is clipped before occupied/free measurement",
    "4.01 hullOccupancy must not be reused as scene occupiedFraction",
    "visual mass values must not be used to infer occupied mask geometry",
    "alpha magnitude must not become fractional free-space area unless an explicit custom support policy defines binary membership",
    "render antialiasing is not a free-space metric",
    "missing support set is not equivalent to explicit empty support set",
    "zero free area is a valid result for fully occupied domain",
    "zero occupied area is a valid result for explicitly empty included support set",
    "occupiedFraction/freeFraction are descriptors, not scores",
    "occupiedFraction and freeFraction are algebraic complements and not independent votes",
    "scene masks remain separate from Topic8 grid occupancy",
    "connected empty regions/clearance remain Compo5.02",
    "figure-ground relations remain Compo5.03",
    "target-aware whitespace/free-space scoring remains Compo5.04",
    "global balance/hierarchy/eye-flow remain future owners",
    "N/A != 0",
    "no beautyScore",
    "ObjectSupportSet.state is mandatory; refs=[] is a valid empty scene only when state=EXPLICIT",
    "PARTIAL support set may produce diagnostics but must not publish canonical occupied/free fractions as if complete",
    "MISSING support set publishes N/A, never occupiedFraction=0/freeFraction=1"
  ],
  "initial_heuristics": {
    "vector_boolean_area_tolerance_px2": {
      "value": 1e-06,
      "provenance": "IMPLEMENTATION_HEURISTIC"
    },
    "raster_support_alpha_epsilon": {
      "value": 0.001,
      "provenance": "IMPLEMENTATION_HEURISTIC",
      "note": "used only for ANY_NONZERO when no stronger owner threshold exists"
    },
    "max_raster_cells": {
      "value": 4194304,
      "provenance": "IMPLEMENTATION_HEURISTIC"
    }
  },
  "correction_policy": {
    "foreign_geometry_mutation": "FORBIDDEN",
    "invalid_domain": "request domain/canvas owner correction",
    "coordinate_mismatch": "request transform/domain adapter",
    "unresolved_object_support": "route to Topic3/render support owner",
    "visibility_or_occlusion_missing": "request visibility/occlusion adapter",
    "alpha_policy_missing": "request paint/render support owner or explicit policy",
    "mask_boolean_failure": "request backend fallback with bounded error; do not invent area",
    "empty_region_issue": "route to Compo5.02",
    "figure_ground_issue": "route to Compo5.03",
    "target_preference_issue": "route to Compo5.04"
  },
  "deferred_inputs": [
    "Compo5.02 connected empty regions / clearance / breathing room",
    "Compo5.03 figure-ground relations",
    "Compo5.04 target-aware scoring/corrections/regression",
    "Topic6 canonical canvas/format/domain normalization",
    "Topic8 grid occupancy",
    "future global balance/hierarchy/eye-flow"
  ],
  "recompute_when": [
    "CompositionSpaceDomain boundary/version changes",
    "included support set changes",
    "any object support geometry changes",
    "mask policy changes",
    "visibility/occlusion/alpha support changes",
    "clip/crop domain changes",
    "vector/raster fallback policy or tolerance changes"
  ],
  "finality": "SCENE_OCCUPIED_AND_FREE_MASK_GEOMETRY_ONLY",
  "object_support_set_schema": {
    "supportSetRef": "string",
    "state": "EXPLICIT|PARTIAL|MISSING",
    "refs": "ObjectSupportRef[]",
    "unresolvedRefs": "optional refs[] for PARTIAL",
    "semantics": {
      "EXPLICIT": "complete included support set; refs may be empty and that is a valid empty scene",
      "PARTIAL": "some support evidence unresolved; canonical occupied/free metrics are N/A until completed",
      "MISSING": "support set not supplied; not equivalent to empty"
    },
    "confidence": "0..1",
    "provenance": "object"
  }
}
ARCHITECTURE CHECKPOINT · 5.01 OWNS SCENE-DOMAIN OCCUPIED/FREE MASKS, THEIR AREAS AND FRACTIONS. SUPPORTS ARE BOOLEAN-UNIONED AND CLIPPED TO THE SAME EXPLICIT DOMAIN; FREE MASK IS THE COMPLEMENT UNDER THE SAME POLICY. ALPHA/VISIBILITY ONLY RESOLVE BINARY SUPPORT MEMBERSHIP; VISUAL MASS REMAINS TOPIC4. HULLOCCUPANCY 4.01 IS NOT SCENE OCCUPANCY. CONNECTED EMPTY REGIONS/CLEARANCE → 5.02; FIGURE-GROUND → 5.03; TARGET SCORING → 5.04; GRID OCCUPANCY → TOPIC8. MORE FREE SPACE ≠ BETTER. NO BEAUTYSCORE.
VISITS / ...