[PR #1081] [CLOSED] fix(build): qualify size_t in vmm.hpp (GCC 12 rejects the unqualified name) #3010

Closed
opened 2026-11-04 02:04:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1081
Author: @aleesposito85
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/vmm-size_t-gcc12-v2


📝 Commits (1)

  • bd6cee7 fix(build): qualify size_t in vmm.hpp (GCC 12 rejects the unqualified name)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 include/strata/core/vmm.hpp (+1 -1)

📄 Description

Problem

include/strata/core/vmm.hpp:36 uses an unqualified size_t:

bool mapped(int64_t i) const { return i >= 0 && i < chunks() && h_[(size_t) i] != 0; }

The header provides for itself with only <cstdint> and <vector>, and on GCC 12.2 (Debian 12's libstdc++) neither brings ::size_t into scope. src/core/vmm.cpp includes this header first, so the CUDA 12 engine build stops at 87%:

[ 87%] Building CXX object CMakeFiles/strata_engine.dir/src/core/vmm.cpp.o
/opt/strata-0140/include/strata/core/vmm.hpp:36:73: error: 'size_t' was not declared in this scope;
                                                 did you mean 'std::size_t'?

src/core/vmm.cpp is new in 0.1.40 (added at the release tip 1735d64). 0.1.39 built fine on the same machine and toolchain.

Environment (where this reproduced)

  • Debian 12 container, g++ (Debian 12.2.0-14+deb12u1) 12.2.0, CUDA Toolkit 12.8, CMake 4.4.3
  • The documented CUDA 12 build: -DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES="70;60" -DSTRATA_ENABLE_CUDA=ON
  • set(CMAKE_CXX_STANDARD 20) (top-level default)

Minimal reproduction

Standalone, both C++17 and C++20 (so it is not a language-version issue):

#include <cstdint>
#include <vector>
struct X { std::vector<unsigned long long> h_;
  bool mapped(long long i) const { return i >= 0 && h_[(size_t) i] != 0; } };
g++ 12.2: error: 'size_t' was not declared in this scope; did you mean 'std::size_t'?

Fix

-    bool mapped(int64_t i) const { return i >= 0 && i < chunks() && h_[(size_t) i] != 0; }
+    bool mapped(int64_t i) const { return i >= 0 && i < chunks() && h_[(std::size_t) i] != 0; }

One token, compile-only: no behavior change. expert_cache.hpp already uses the std::size_t spelling, so this matches the house style; adding <cstddef> would also fix it, but the qualified name keeps the diff minimal.

Verified

  • V100 (sm_70) + P100 (sm_60) box, the CUDA 12 / SM60 build recipe above: configure rc=0, build rc=0 with this change; binary carries 58x sm_60 + 58x sm_70 cubins; engine 0.1.40 has been serving since (strata generate: session is up (engine 0.1.40)).
  • The unpatched tree fails at vmm.cpp (87%), the patched tree passes it - nothing else in the file or its callers changed.
  • Still present on the tip this branch is based on (82f46a8, 0.1.40.1): include/strata/core/vmm.hpp:36 unchanged.

Related but distinct: #1071 (missing CUDART_VERSION guard in the same new file for toolkits < 12.5) - this one hits newer toolkits too, so the two together cover CUDA 12.0-12.8 source builds.

Re-file note: this was opened earlier today as #1076; the 0.1.40.1 history cleanup force-pushed its base and GitHub auto-closed it. Same one-token fix, same verification, rebased on 82f46a8.

Benchmark context for this build (the V100 + P100 rig this fix was verified on): #1079 — now updated with post-0.1.40 numbers, including the --prefill auto:32768 and PCIe Gen1 findings.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1081 **Author:** [@aleesposito85](https://github.com/aleesposito85) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/vmm-size_t-gcc12-v2` --- ### 📝 Commits (1) - [`bd6cee7`](https://github.com/Niko1221/Strata/commit/bd6cee721fd7f273124e5d09ca188fe44acbd65e) fix(build): qualify size_t in vmm.hpp (GCC 12 rejects the unqualified name) ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `include/strata/core/vmm.hpp` (+1 -1) </details> ### 📄 Description ## Problem `include/strata/core/vmm.hpp:36` uses an **unqualified** `size_t`: ```cpp bool mapped(int64_t i) const { return i >= 0 && i < chunks() && h_[(size_t) i] != 0; } ``` The header provides for itself with only `<cstdint>` and `<vector>`, and on GCC 12.2 (Debian 12's libstdc++) neither brings `::size_t` into scope. `src/core/vmm.cpp` includes this header first, so the **CUDA 12 engine build stops at 87%**: ``` [ 87%] Building CXX object CMakeFiles/strata_engine.dir/src/core/vmm.cpp.o /opt/strata-0140/include/strata/core/vmm.hpp:36:73: error: 'size_t' was not declared in this scope; did you mean 'std::size_t'? ``` `src/core/vmm.cpp` is **new in 0.1.40** (added at the release tip `1735d64`). 0.1.39 built fine on the same machine and toolchain. ## Environment (where this reproduced) - Debian 12 container, `g++ (Debian 12.2.0-14+deb12u1) 12.2.0`, CUDA Toolkit 12.8, CMake 4.4.3 - The documented CUDA 12 build: `-DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES="70;60" -DSTRATA_ENABLE_CUDA=ON` - `set(CMAKE_CXX_STANDARD 20)` (top-level default) ## Minimal reproduction Standalone, both C++17 and C++20 (so it is not a language-version issue): ```cpp #include <cstdint> #include <vector> struct X { std::vector<unsigned long long> h_; bool mapped(long long i) const { return i >= 0 && h_[(size_t) i] != 0; } }; ``` ``` g++ 12.2: error: 'size_t' was not declared in this scope; did you mean 'std::size_t'? ``` ## Fix ```diff - bool mapped(int64_t i) const { return i >= 0 && i < chunks() && h_[(size_t) i] != 0; } + bool mapped(int64_t i) const { return i >= 0 && i < chunks() && h_[(std::size_t) i] != 0; } ``` One token, compile-only: no behavior change. `expert_cache.hpp` already uses the `std::size_t` spelling, so this matches the house style; adding `<cstddef>` would also fix it, but the qualified name keeps the diff minimal. ## Verified - V100 (sm_70) + P100 (sm_60) box, the CUDA 12 / SM60 build recipe above: **configure rc=0, build rc=0** with this change; binary carries 58x `sm_60` + 58x `sm_70` cubins; engine 0.1.40 has been serving since (`strata generate: session is up (engine 0.1.40)`). - The unpatched tree fails at `vmm.cpp` (87%), the patched tree passes it - nothing else in the file or its callers changed. - Still present on the tip this branch is based on (`82f46a8`, 0.1.40.1): `include/strata/core/vmm.hpp:36` unchanged. Related but distinct: #1071 (missing `CUDART_VERSION` guard in the same new file for toolkits < 12.5) - this one hits newer toolkits too, so the two together cover CUDA 12.0-12.8 source builds. Re-file note: this was opened earlier today as #1076; the 0.1.40.1 history cleanup force-pushed its base and GitHub auto-closed it. Same one-token fix, same verification, rebased on `82f46a8`. Benchmark context for this build (the V100 + P100 rig this fix was verified on): #1079 — now updated with post-0.1.40 numbers, including the `--prefill auto:32768` and PCIe Gen1 findings. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:04:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3010
No description provided.