chore(optimizations): remove legacy pflash and spark Python packages
Merged
GR
1d ago+83+83+01234567890123456789-2029-2029-0123456789012345678901234567890123456789
Why
PFlash v2 and Luce Spark both run in-process in C++ inside luce_server. The standalone Python packages in optimizations/pflash/ (DflashClient, bench_niah_cpp.py, niah_gen.py) and optimizations/spark/ (_daemon.py, calibrate.py, bench.py, train_pregate.py) were legacy test_dflash stdin wrappers with zero callers in server/ or harness/, yet pflash was still installed into every uv workspace, Docker image, and pytest run.
Change
- Remove legacy Python packages: Delete
optimizations/pflash/{pflash,tests,pyproject.toml}andoptimizations/spark/{spark,pyproject.toml}while keeping each directory'sREADME.md,RESULTS.md, and media. - Unwire
pflashfrom workspace, Docker, and CI: Removepflashfrompyproject.toml(dependencies, ruff exclude, pytesttestpaths, uv workspace members/sources), regenerateuv.lock(removes onlypflash v0.3.0;luceandtorchstill supplytransformersandsetuptools), dropCOPY optimizations/pflashlayers fromDockerfileandDockerfile.rocm, and update.github/workflows/ci.yml,.github/ci/test_ci_plan.py,CONTRIBUTING.md,variables.md, andserver/test/python/test_full_compress_cache.py. - Document optimization ownership: Add
optimizations/README.mdmapping each subdirectory to its runtime owner inserver/src/(and notingmegakernel/as the only compiled subproject here). - Align surviving docs with
luce_server: Updateoptimizations/pflash/README.md(direct download of publishedQwen3.5-0.8B-BF16.ggufand DFlashconfig.json,seg-scoring-head.gguf+--pflash on, aggregate region admission rules,--fa-windowvsLUCE_FA_WINDOW,test_dflash --daemonstdin/stream-fd protocol, supported backends exposingpflash_gives_candidate_scores(), citation URL),optimizations/spark/README.md(--spark-vramtarget semantics, first-boot history bootstrap, citation URL), and label historical script references inserver/RESULTS.md,optimizations/spark/RESULTS.md, andserver/docs/laguna_integration_plan.md. - Unblock CUDA Docker build (GCC 11): Add
#include <cstddef>and usestd::size_tincontiguous_block_run(server/src/common/concurrency/paged_kv_pool.h), fixing the pre-existingmainGCC 11 compile failure inDocker prebuilds / cuda12. - Unchanged:
optimizations/megakernel/,optimizations/image_gen/,optimizations/kvflash/,optimizations/paged_attention/, and server runtime behavior.
Measured / Tested
uv lock --check --offline: passed (85 packages;uv.lockdiff removes onlypflash v0.3.0).ruff check: passed.pytest .github/ci/: 122 passed (includingtest_ci_plan.py,test_docs_paths.py,test_check_commit_messages.py).- Relative Markdown link check across all 8 modified/added
.mdfiles: 0 broken links. test_paged_kv_pool(g++ -std=c++17): 18 passed, plus standalone syntax check onpaged_kv_pool.h.- CI on prior head:
Docker prebuilds / rocm,uv workspace,Build megakernel,Commit messages,CodeQL,GPU tests (DGX GB10), andBuild Windows (ROCm HIP)all passed. - End-to-end model run skipped: the only C++ edit is adding
#include <cstddef>/std::size_ttopaged_kv_pool.h, with no runtime behavior change.
Review
- Fixed all 13 verified findings from Sol 6.2 (
high) andcubic-dev-ai: replaced missingconvert_hf_to_gguf.pywith publishedQwen3.5-0.8B-BF16.gguf, added DFlashconfig.jsondownload, fixedseg-scoring-head.ggufpath and--pflash on, corrected aggregate region admission (active tool outputs only aggregate within the current turn), fixedtest_dflash --daemonlaunch/command/--stream-fdprotocol, separated--fa-window(luce_server) fromLUCE_FA_WINDOW(test_dflash/ entrypoint), updated supported PFlash backends (pflash_gives_candidate_scores(), addinginkling2and excludinglaguna), fixed Spark--spark-vram/ history bootstrap wording, updatedCONTRIBUTING.mdandoptimizations/README.mdownership links, fixed 404 citation URLs, and labeled historical scripts inserver/RESULTS.md,optimizations/spark/RESULTS.md, andserver/docs/laguna_integration_plan.md. - Also included the GCC 11
#include <cstddef>fix inserver/src/common/concurrency/paged_kv_pool.hto unblockDocker prebuilds / cuda12.
Cleanup
tidy(Standard + Deslop): verified all hunks, lockfile diff, and relative links; no extra code or slop found.prune-tests/test-audit: deletedoptimizations/pflash/tests/test_dflash_client.pywithDflashClient; audited.github/ci/test_ci_plan.pyandserver/test/python/test_full_compress_cache.py— all remaining tests enforce live contracts (0 deletions).
Limits
- Waiting for the re-triggered
Docker prebuilds / cuda12run to confirm the full CUDA image build and runtimeuv syncpass end to end.