feat(cache): add shared HTTP action cache and parallel snapshot hashing
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 4s

- D1: RemoteCasClient + registry /api/v1/cas endpoints with bearer auth and digest verification, StateStore remote action/blob APIs, build-path-independent action keys, --remote-cache CLI
- D2: parallel snapshot revalidation hashing via Void::Concurrency::ThreadPool
- Verified in Docker GCC 16: 8/8 CTest suites, cross-build-dir 100% cache hit, 5001-file warm no-op 374 ms
- Fix self-host recipe source list for RemoteCache.cpp and accept GCC 16 -lgcc_s_asneeded
This commit is contained in:
faumaray committed 2026-12-03 12:36:21 +03:00
1 parent 6c225c2dff
commit 09c0a91d1d
19 files changed
+1213 -18

No files matched your search

+58 -2
View File
@@ -100,10 +100,66 @@ dev cpp-gcc -c build/dev/bin/vbs_benchmarks --files 15
{"fixture_files":16,"compiler":"g++ (GCC) 16.2.0","snapshot_ms":19,"cold_build_ms":334,"cold_executed":17,"warm_noop_ms":4,"warm_executed":0,"warm_cached":17}
```
## Track D1/D2 Verification in Docker (2026-12-03)
The host shell lacks `dev`/GCC 16, so the build and tests were run inside the existing
`voidlibrary-dev:latest` Docker image (GCC 16.0.1, CMake 4.2.3, Ninja 1.11.1). CMake fetched
the exact pinned VoidLibrary commit `3e254055e081a104f08df68dde39711bc7813518` inside the
container (network access works there).
```sh
docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD":/src -w /src \
voidlibrary-dev:latest bash -lc '
cmake -S . -B build/docker-pinned -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON &&
cmake --build build/docker-pinned --parallel 4 &&
ctest --test-dir build/docker-pinned --output-on-failure'
```
- Configure: exit `0` (`VoidLibrary` cloned at pinned commit `3e25405`).
- Build: `170/170` targets linked (warnings only from dependency headers / aggregate
initialization).
- `ctest`: **8 / 8 passed (100%)** in 374.33 s on the final run:
`vbs_sdk_tests`, `vbs_core_tests` (20.19 s), `vbs_v1_tests` (42.65 s),
`vbs_registry_tests` (11.36 s, includes the remote-CAS round-trip and the D1 acceptance),
`vbs_selfhost_tests` (299.69 s), `vbs_sdk_registration`, `vbs_cli_contract`,
`vbs_description_contract`.
Two pre-existing Docker-toolchain failures were found and fixed during this run:
1. `recipes/SelfHost/VbsSelfHostRecipe.cpp` did not list the new `src/State/RemoteCache.cpp`,
so the native Stage 1 self-host link failed; adding it fixed
`strict_native_full_vbs_stage1_to_stage2_without_cmake`.
2. GCC 16's CMake emits `-lgcc_s_asneeded` (a real as-needed linker script for `libgcc_s`)
in codemodel link fragments. It is now accepted as a safe system link flag in
`src/Provider/Translator.cpp`, fixing
`track_b1_native_c_driver_and_mixed_c_cpp_cmake_meson_translation`.
### D1 acceptance (cross-build-directory 100% cache hit)
`RegistryTests.shared_remote_cache_cold_populates_then_clean_build_all_hits` runs a real
`vbs build` into `build_a` (populating the remote CAS through the live registry), then a
second `vbs build` into a clean `build_b`: the summary reports `0 executed` (all actions
restored from the shared cache), and the produced binary runs successfully.
### D2 5,000-file benchmark
```sh
docker run --rm --user "$(id -u):$(id -g)" -e HOME=/tmp -v "$PWD":/src -w /src \
voidlibrary-dev:latest bash -lc './build/docker-pinned/bin/vbs_benchmarks --files 5000 --jobs 8'
```
```json
{"fixture_files":5001,"compiler":"g++ 16.0.1","snapshot_ms":3997,"cold_build_ms":1270353,"cold_executed":5002,"warm_noop_ms":374,"warm_executed":0,"warm_cached":5002}
```
Warm no-op is **374 ms for 5,001 files** (all 5,002 actions cached, zero executed), meeting
the sub-second D2 acceptance gate.
## Limits and Unrun Checks
1. **HTTPS git fetch in proxy-restricted environment**: Inside this execution environment, outbound HTTPS to `https://git.faumaray.com/Void/VoidLibrary.git` encountered `Proxy CONNECT aborted`; CMake configure and `vbs test` were therefore verified against a clean local detached checkout of the exact pinned commit `3e254055e081a104f08df68dde39711bc7813518` via `VBS_VOID_SOURCE_DIR`.
1. **HTTPS git fetch**: the host shell is proxy-restricted, but the Docker container could clone `https://git.faumaray.com/Void/VoidLibrary.git`; the pinned commit `3e254055e081a104f08df68dde39711bc7813518` was fetched directly for the verification above. A separate configure against the local `/home/faumaray/Projects/Library` checkout via `VBS_VOID_SOURCE_DIR` also succeeded (development-only override, checkout unmodified).
2. **Conan2 live installation**: `conan` is absent in `dev cpp-gcc`; automated testing verified explicit missing-prerequisite failure (`FullV1Tests.cpp`). Live `conan` container verification (Track B3) remains unrun.
3. **Optional external VoidLibrary modules (`Void::Net`, `Void::Sqlite`)**: `Boost`, `OpenSSL`, and `SQLite3` are not installed in `dev cpp-gcc`, so VBS continues using its pure-C++/POSIX loopback HTTP adapters (`HttpServer`, `RegistryClient`) and journaled atomic CAS store (`StateStore`), while retaining optional `Void::Sqlite` CMake detection.
4. **CI workflow & Web UI browser**: [.github/workflows/ci.yml](../../.github/workflows/ci.yml) has not been executed on remote GitHub Actions runners, and `registry/web/` was verified via HTTP/header/static-serving/API/XSS/CSRF tests without a headless browser runner.
5. **Remaining Post-v1 Roadmap ([21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md) & [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md))**: Live `conan` container verification, Track C (Windows/MSVC, macOS/Apple Clang, dual-profile cross-compilation), Track D (shared HTTP CAS, parallel hashing, SBOM/signatures), Track E2 (`workspace.cpp`), Track E3 (`vbs daemon` local socket server + external editor plugins), and Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.
5. **Remaining Post-v1 Roadmap ([21-expansion-roadmap.md](../roadmap/21-expansion-roadmap.md) & [20-future-translation-platforms.md](../roadmap/20-future-translation-platforms.md))**: Live `conan` container verification, Track C (Windows/MSVC, macOS/Apple Clang, dual-profile cross-compilation), Track D1/D2 acceptance scenarios (unit/integration suites pass in Docker; see above), Track D3 (SBOM/signatures), Track E2 (`workspace.cpp`), Track E3 (`vbs daemon` local socket server + external editor plugins), and Track E4 (`Void::Net`/`Void::Sqlite` alignment) remain planned scope.