Abundance-backed proof of space and wgpu GPU plotter - #3
Draft
vedhavyas wants to merge 8 commits into
Draft
Conversation
Latest nightly that still supports generic_const_exprs.
Pull abundance's ab-proof-of-space as a pinned, alloc/parallel-gated git dependency, so the no_std runtime never links it. chia_v2::ChiaV2Table wraps its chiapos Tables, looking proofs up under Subspace's s-bucket convention (find_proof with challenge.to_le_bytes()) so they verify under the existing ChiaTable verifier; verification delegates to ChiaTable. Bumps chacha20 0.10.0 -> 0.10.1 (API-only) to satisfy abundance.
PlotMetadataHeader gains a cutover field (Option<HistorySize>) and a typed PlotMetadataVersion (V0/V1); a version-aware Decode reads old V0 headers as cutover = None and rejects unknown versions (the old-binary lockout). Opening a V0 plot records the cutover as the highest history size among existing sectors and rewrites the header as V1. New-sector plotting then waits until history advances past the cutover, so no sector is stamped at history_size <= cutover and later misread with the old proof-of-space. Sectors at or below the cutover use the old proof-of-space, newer ones the new; nothing dispatches on it yet.
PosTable (subspace-proof-of-space, alloc-gated) dispatches between the old ChiaTable and the new ChiaV2Table; both proofs verify under ChiaTable, so the choice is a farmer-side read/prove concern. The Table trait gains generator_for(is_post_cutover) and SolutionCandidates a history_size() accessor; the farmer picks per sector by comparing history_size against the farm's cutover at reading, proving, and auditing. New sectors always use the new implementation.
Cross-verify abundance-backed proofs against the existing ChiaTable verifier, a plot->read round-trip, and the per-sector V1/V2 dispatch selection. Point the benches at the new table.
Reworks ChiaV2Table onto abundance's dense proof path and adds a wgpu records encoder (Vulkan/Metal) mirroring the CUDA backend, wired into the farm and cluster plotters behind a wgpu cargo feature. Abundance dependencies are patched to my fork for review.
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.
The CPU abundance-backed proof of space work (the five commits also in autonomys#3878) plus the wgpu GPU plotter on top.
The CPU commits pull abundance's proof of space in as a git dependency wrapped as
ChiaV2Table, add a farm-level cutover point so old sectors keep reading on the old path while new ones plot on abundance, and dispatch per sector by history size.The last commit is the GPU side:
ChiaV2Tablemoves to abundance's dense proof path, and a newsubspace-proof-of-space-wgpucrate drives abundance's wgpu shaders (Vulkan/Metal) and feeds the proofs into our interleaved KZG encode, mirroring the CUDA backend. It is wired into the farm and cluster plotters behind awgpufeature that, unlike cuda/rocm, builds on macOS too.Abundance deps are patched to my fork (vedhavyas/abundance) for now so this builds end to end; that gets re-pointed upstream once the abundance side lands. GPU/CPU byte-identity still needs abundance's find_proofs Metal fix before it can be validated end to end.