Skip to content

G1a: связать эмиссию альфа-аналога с exact occurrence - #354

Merged
lemone112 merged 2 commits into
mainfrom
agent/g1a-alpha-exact
Jul 19, 2026
Merged

G1a: связать эмиссию альфа-аналога с exact occurrence#354
lemone112 merged 2 commits into
mainfrom
agent/g1a-alpha-exact

Conversation

@lemone112

@lemone112 lemone112 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Корневая проблема

AlphaAnalog имел несколько параллельных источников истины: proposal выбирал (tint, alpha), semantic-эмиссия отдельно композитила результат, а named runtime заново ветвился по recipe. Поэтому точность кандидата ещё не доказывала точность фактически эмитируемого occurrence.

Что меняется

  • encoded-sRGB8 source-over вынесен в один нижний private kernel;
  • static point-program материализует ровно один финальный occurrence;
  • ExactSrgb8IdentityV1 допускает output только при побайтном равенстве цели;
  • public hex helper и semantic path используют один analog::resolve_verified;
  • NamedRoleTable один раз компилирует sparse AlphaAnalog binding plan и исполняет его по declaration ordinal, не читая recipe-kind в runtime;
  • physical certificate отделён от authored/routing identity;
  • старый AlphaAnalog verifier и повторный semantic composite удалены.

Публичные Rust/WASM/DTO/TypeScript поверхности не меняются. В срез не входят public Program, Pair/WCAG, session/runtime observations, field/glass и новые recipe-варианты.

Доказательства

  • RED → GREEN: semantic source-over 2 → 1;
  • corrupted candidate не может создать verified output;
  • independent exhaustive oracle перебирает все 256 тинтов для каждого sRGB8 channel pair и фиксирует канонический nearest-tint с lower-byte tie-break;
  • exhaustive 65 536 channel-pair floor oracle и property differential public/named paths;
  • compiled binding plan строится один раз, clone/re-resolve его не перекомпилируют;
  • exact point execution: 0 heap allocations;
  • mutation universe G1a: 120 непересекающихся кандидатов — 84 caught, 14 детерминированных nontermination timeout, 22 unviable, 0 missed; бывшие 9 survivors отдельно: 9/9 caught;
  • cargo test --workspace --locked: core 573 passed / 6 ignored, все integration suites green;
  • clippy all-targets -D warnings, fmt, rustdoc -D warnings, git diff --check: green;
  • generated .d.ts byte-identical, JS export-set diff пуст.

Размер

Canonical Linux x64 CI run 29691640790 измерил byte-identical repeated artifact: 385346 → 387276 B (+1930 B), gzip diagnostic 170658 B, SHA-256 310b54201a80e9c9c2212ddfc94c76b7a3cf4a7b8a3dfd003d7a1e38ad39bfae. Current budget привязан к этому run и равен ровно 387276 B: arbitrary headroom отсутствует.

Summary by CodeRabbit

  • Новые возможности

    • Улучшена обработка рецептов AlphaAnalog: система подбирает точные значения оттенка и прозрачности для побайтного соответствия целевому цвету.
    • Добавлена строгая проверка достижимости результата и корректности входной прозрачности.
  • Исправления

    • Устранены расхождения между рассчитанным композитом и финальным отображаемым цветом.
    • Некорректные значения прозрачности теперь отклоняются с более понятными сообщениями.
    • Повышена стабильность результатов для именованных цветовых наборов.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d467bb02-14f7-4d54-b460-a5b7ca303241

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Добавлен exact encoded-sRGB8 слой композиции и alpha-analog resolver с проверкой occurrence. Appearance bindings и certificates перестроены, а semantic pipeline использует заранее скомпилированные AlphaAnalog invocations. Тесты, mutation scope и WASM budget обновлены.

Changes

AlphaAnalog exact pipeline

Layer / File(s) Summary
Композиция и identity-контракты
crates/labcolors-core/src/lib.rs, crates/labcolors-core/src/composition.rs, crates/labcolors-core/src/appearance.rs, crates/labcolors-core/src/constraints/*
Добавлены exact source-over операции и sRGB8 identity constraint; occurrence bindings, certificates и physical identity обновлены для разделения физического результата и routing.
Verified alpha-analog resolver
crates/labcolors-core/src/analog.rs, crates/labcolors-core/src/alpha.rs, crates/labcolors-core/src/test_support.rs
Добавлены поиск первой достижимой alpha, канонический tint, exact evaluation и evidence; старый alpha-analog путь удалён, facade делегирует resolve_verified.
Compiled semantic dispatch
crates/labcolors-core/src/semantic.rs, crates/labcolors-core/src/config.rs, crates/labcolors-core/src/config/tests.rs, crates/labcolors-core/src/*tests.rs
NamedRoleTable компилирует AlphaAnalog invocations заранее, semantic resolution dispatch’ит их по declaration ordinal, а проверки используют final occurrence и byte identity.
Тестовая и budget-валидация
.cargo/mutants.toml, packages/colors/bench/wasm.json, scripts/check-wasm-size-budget.mjs
Обновлены mutation-testing scope и пояснения timeout, а также WASM measurement, budget и ожидаемый SHA-256.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно отражает основную идею PR: связывание эмиссии альфа-аналога с точным exact occurrence.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/g1a-alpha-exact

Comment @coderabbitai help to get the list of available commands.

@lemone112
lemone112 marked this pull request as ready for review July 19, 2026 15:01
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant