JS: пересобирать alpha occurrence на текущей подложке - #483
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
WalkthroughИзменён recheck-поток ChangesАдаптивная проверка контрастности
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant adaptTheme
participant recheckSamples
participant __over
participant Engine
adaptTheme->>recheckSamples: передаёт recheckOccurrences
recheckSamples->>__over: материализует translucent occurrence
recheckSamples->>Engine: вызывает recheckContrast или recheckContrastMulti
Engine-->>recheckSamples: возвращает значения Lc
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai full review Проверьте точный head |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 14 minutes. |
|
@coderabbitai full review Повторный exact-head запрос после rate-limit. Head неизменен: |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 11 minutes. |
|
@coderabbitai full review Exact-head gate: проверьте неизменный head |
|
Проверю все восемь изменённых файлов, в частности:
🐇🔍 ✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 24 seconds. |
|
@coderabbitai full review Повтор после указанного вами окна ( |
|
Проверка охватит все восемь изменённых файлов: сохранение публичной границы, отдельную рематериализацию каждого translucent occurrence для каждого текущего backdrop, порядок mixed-наборов, opaque packed-path, документацию canvas-контракта и benchmark/corpus. 🐇🔍 ✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/colors/adapt-theme.js`:
- Around line 438-440: Document the new buffer-lifetime contract for the
reusable foregroundRow passed to recheckContrast: add a comment at this call
site stating that the Uint32Array is valid only during the synchronous
invocation and must not be retained, cached, or accessed asynchronously. Update
the recheckContrast description in the README with the same constraint.
In `@packages/colors/bench/misses.mjs`:
- Around line 5-9: Update the source matching and capacity parsing in the
benchmark so it accepts Rust declarations with optional pub visibility, flexible
whitespace, digit separators, and trailing comments. Normalize digit separators
before converting the captured value to Number, while preserving the existing
safe-integer and RGB24_MAX validation in the capacity check.
In `@packages/colors/bench/wasm-boundary.bench.mjs`:
- Around line 153-154: Update the benchmark flow around recheckOpaqueMulti3 and
its corresponding per-role output to skip the opaque batch capability ×3
scenario whenever OPAQUE_FGSW.length === 0. Preserve the existing execution and
division behavior for non-empty opaque batches, and apply the same guard to the
additional referenced occurrence.
- Around line 124-131: Update materializeOccurrences to mirror adaptTheme’s
INVALID_RGB24 sentinel check after __over: when compositing returns the
sentinel, preserve the typed rejection behavior instead of writing the invalid
value into row or the computation fingerprint; retain the existing direct
sourceRgb24 path for fully opaque occurrences.
In `@packages/colors/test/adapt-theme.test.mjs`:
- Around line 3937-3949: Update the test “mixed occurrence rows preserve order
and materialize alpha per backdrop” to assert the exact set of backdrops present
in replay.rechecks, rather than only checking rechecks.length >= 2. Derive the
checked backdrops from replay.rechecks and compare them with the declared
`#000000` and `#FFFFFF` samples, while preserving the existing row and resolves
assertions.
In `@packages/colors/test/hotpath-parity.test.mjs`:
- Around line 236-248: Replace the source-text assertions in the test “the
boundary benchmark measures the shipping mixed occurrence path” with behavioral
coverage. Extract materializeOccurrences and OCCURRENCES construction into a
shared module beside misses.mjs, import that module in the benchmark and test,
and add direct assertions that an alpha occurrence on two different backdrops
produces two distinct words while an opaque occurrence produces the same word.
- Line 270: Update the test loop around colors.resolveTheme to explicitly assert
that each background in ring is admissible, catching resolution failures and
reporting the specific background that caused the failure instead of allowing an
unhandled exception. Preserve the existing dark-theme resolution behavior for
every ring entry.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b7ad1b49-be35-4cb4-a0d7-7814260d293a
📒 Files selected for processing (8)
packages/colors/README.mdpackages/colors/adapt-theme.jspackages/colors/bench/misses.mjspackages/colors/bench/wasm-boundary.bench.mjspackages/colors/test/adapt-theme-translucent.test.mjspackages/colors/test/adapt-theme.test.mjspackages/colors/test/hotpath-parity.test.mjspackages/colors/test/public-api-cleanup.test.mjs
|
Все 7 замечаний проверены и закрыты в exact head Единственное уточнение к предложенному oracle: runtime законно выполняет два полных прохода по samples — current recheck и candidate-admission recheck. Поэтому тест фиксирует точную последовательность Проверки exact head локально: 275/275 package tests, targeted 4/4, typecheck, pinned npm 11.9 release verification и реальный boundary benchmark; fingerprints сохранились |
|
@coderabbitai full review Повторный exact-head review после закрытия всех 7 доказанных замечаний. Head: |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='f61638223fcca02deeb6493b60f645e24b30a3d1'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\nMATCH=%s\n' "$actual" "$expected" "$([ "$actual" = "$expected" ] && echo yes || echo no)"
base="$(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)"
printf '\nBASE=%s\nCHANGED_FILES:\n' "$base"
git diff --name-status "$base"...HEAD
printf '\nDIFF_STAT:\n'
git diff --stat "$base"...HEAD
printf '\nOUTLINES:\n'
for file in \
packages/colors/adapt-theme.js \
packages/colors/bench/misses.mjs \
packages/colors/bench/wasm-boundary.bench.mjs \
packages/colors/test/adapt-theme-translucent.test.mjs \
packages/colors/test/adapt-theme.test.mjs \
packages/colors/test/hotpath-parity.test.mjs \
packages/colors/test/public-api-cleanup.test.mjs
do
if [ -f "$file" ]; then
printf '\n--- %s ---\n' "$file"
ast-grep outline "$file" --items all 2>/dev/null || true
fi
doneLength of output: 8529 🏁 Script executed: #!/bin/bash
set -euo pipefail
base='2404938f47a32af887c5b811dee280fbac64169e'
printf '%s\n' '=== CHANGED HUNKS: runtime, public surface, docs ==='
git diff --unified=80 "$base"...HEAD -- \
packages/colors/adapt-theme.js \
packages/colors/README.md \
packages/colors/test/public-api-cleanup.test.mjs
printf '%s\n' '=== NEW BENCHMARK HELPERS ==='
ast-grep outline packages/colors/bench/occurrences.mjs --items all
cat -n packages/colors/bench/occurrences.mjs
printf '%s\n' '=== CHANGED HUNKS: benchmark helpers ==='
git diff --unified=80 "$base"...HEAD -- \
packages/colors/bench/misses.mjs \
packages/colors/bench/occurrences.mjs \
packages/colors/bench/wasm-boundary.bench.mjs
printf '%s\n' '=== CHANGED TEST HUNKS ==='
git diff --unified=30 "$base"...HEAD -- \
packages/colors/test/adapt-theme-translucent.test.mjs \
packages/colors/test/adapt-theme.test.mjs \
packages/colors/test/hotpath-parity.test.mjs
printf '%s\n' '=== PUBLIC EXPORTS / OPTIONS REFERENCES ==='
ast-grep outline packages/colors/index.js --items all 2>/dev/null || true
rg -n -C 3 --glob '*.js' --glob '*.mjs' \
'adaptTheme\s*\(|recheckContrastMulti\s*\(|recheckContrast\s*\(|recheckOccurrences|benchmarkOccurrencesFromRoles|fallback|canvas' \
packages/colorsLength of output: 150079 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '=== adapt-theme: recheck selection/materialization ==='
sed -n '330,475p' packages/colors/adapt-theme.js
printf '%s\n' '=== adapt-theme: candidate occurrence admission ==='
sed -n '530,720p' packages/colors/adapt-theme.js
printf '%s\n' '=== adapt-theme: tick/glow dispatch ==='
sed -n '1035,1110p' packages/colors/adapt-theme.js
printf '%s\n' '=== occurrences helper ==='
cat -n packages/colors/bench/occurrences.mjs
printf '%s\n' '=== cache-miss helper ==='
cat -n packages/colors/bench/misses.mjs
printf '%s\n' '=== README exact diff ==='
git diff --unified=30 2404938f47a32af887c5b811dee280fbac64169e...HEAD -- packages/colors/README.md
printf '%s\n' '=== public export exact diff ==='
git diff --unified=10 2404938f47a32af887c5b811dee280fbac64169e...HEAD -- packages/colors/index.js packages/colors/package.json
printf '%s\n' '=== runtime references to legacy role/composite inputs ==='
rg -n -C 2 'recheckRoles|recheckFgs|compositeHex|compositeLc|recheckOccurrences' \
packages/colors/adapt-theme.js
printf '%s\n' '=== test names added on this exact head ==='
git diff --unified=0 2404938f47a32af887c5b811dee280fbac64169e...HEAD -- packages/colors/test \
| rg '^\+test\(' || trueLength of output: 37943
Проверено:
Независимо запускать тесты в read-only sandbox я не мог; это соответствует предоставленным вами результатам package/targeted/typecheck/release/benchmark verification. ✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 29 minutes. |
Что изменено
adaptThemeхранит для каждого физического occurrence исходный sRGB8 и alpha, а не только composite старого solve.__over; смешанные наборы проверяются в исходном порядке без ложного shared-foreground batch.canvas-контрактом; удалён выдуманныйfallback.Почему
Старый controller повторно проверял frozen
compositeHex, вычисленный на solve-backdrop. После изменения backdrop это уже не физический цвет translucent occurrence, поэтому runtime мог пропустить реальный breach или сообщить ложный.Граница среза
Это bounded safety bridge для текущего legacy JS runtime, не V3 Program API. Публичная поверхность не расширена. Текущий WASM DTO допускает alpha только в
(0, 1]; alpha=0 появится только сквозным atomicPaintValueв Program, без forged JS-only состояния.Проверки
cb51c5aповерхmain@2404938;git range-diff: 5/5 патчей сохранены при rebase;274 passed, 0 failed;npm run typecheck;npm run release:verify: clean archive reproduced and verified;#1099FF;Summary by CodeRabbit
Документация
adaptTheme.canvasдля прозрачных корней.Улучшения
Unknown.