feat(pixel-grid): add independent native grid reconstructor - #495
Open
huyanxius wants to merge 12 commits into
Open
feat(pixel-grid): add independent native grid reconstructor#495huyanxius wants to merge 12 commits into
huyanxius wants to merge 12 commits into
Conversation
Detected grids need a separate local stage that can rebuild one color per cell. Add deterministic two-stage reconstruction with bounded memory and explicit grid arguments. Images can now be rebuilt without invoking detection, application services, or generation flows.
The native reconstructor needs a reproducible package boundary and dependency graph. Add the Rust manifest, locked dependencies, and local target exclusion. The reconstruction module can now build independently with deterministic inputs.
Explicit reconstruction must preserve source colors without creating dense-grid artifacts. Cover exact cells, uncapped final palettes, bad points, input limits, and working-set rejection. Color and resource regressions now fail before this module reaches the application layer.
The extracted reconstruction algorithm must remain traceable and license compliant. Document its explicit-grid contract, two-stage color behavior, fixed upstream revision, and MIT terms. Maintainers can review the reuse boundary without consulting the generation codebase.
The standalone reconstructor needs a narrow gate independent of backend CI. Run format and locked release tests only for reconstructor paths and its workflow. Reconstruction changes now receive isolated validation without touching generation jobs.
|
Deployment failed for project windup with the following error: Learn More: https://vercel.com/huyan-s-projects1?upgradeToPro=build-rate-limit |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
11 tasks
Transparent pixel metadata could tint a cell that reconstructs as opaque. Exclude non-visible pixels from selected and fallback visible color averages. Opaque cell colors now reflect only pixels that contribute visible color.
The visible-color regression needs a fixture with conflicting hidden RGB data. Add a majority-opaque red cell whose transparent pixels store blue channels. The test prevents hidden PNG metadata from tinting reconstructed output.
The reconstructor is a native algorithm library rather than Python backend code. Move the independent crate to the root native area and remove the retired CLI. The later PyO3 binding can consume it without coupling this module to Python.
The reconstructor workflow still watched the retired backend-native path. Point path filters and the working directory at the independent native crate. Reconstruction checks now run for the relocated module.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
xyh202131
approved these changes
Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增与检测器和业务应用解耦的显式网格重建库:调用方给定网格后,Rust 模块返回每格单色的原生 1x PNG;源码位于仓库根目录,不属于 Python 后端。
Why
网格识别与像素重建是两种不同职责。把重建逻辑绑定在检测器、Python 后端或生成管线中,会导致后续替换检测算法时同时改动颜色恢复,并扩大本地算法的业务耦合。
Changes
cols、rows、colors并返回 PNG。colors只控制结构聚类,不硬性截断最终全局色板。native/pixel-perfect/crates/reconstructor/,删除生产 stdin/stdout CLI。Implementation
reconstruct_bytes是唯一算法入口;网格参数是唯一空间契约,模块不推断像素密度。Verification
cargo fmt --check:通过。cargo test --release --locked:8 项测试通过,0 项失败。git diff --check upstream/main...HEAD:通过。Scope
colors不是最终图片颜色数上限,不强制 16 色,也不额外引入黑色。Related Issues
Closes #491
Refs #489