[32-bit] nvfp4_plan_cache.h fails with size_t narrowing on i586
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- build-system
Research direction
Start with src/vt/cuda/nvfp4_plan_cache.h and inspect the kGolden definition. Build v0.0.2 for i586 with the normal openSUSE optimization flags, C++20, and -Werror=narrowing to reproduce the failure. Done means the header compiles on both 32-bit and 64-bit size_t targets without narrowing diagnostics.
Written by the indexing model from the issue text.
Description
Problem
The v0.0.2 source does not compile for i586/32-bit x86 with GCC and -Werror=narrowing. The failure is in src/vt/cuda/nvfp4_plan_cache.h:
constexpr size_t kGolden = sizeof(size_t) == 8 ? size_t{0x9e3779b97f4a7c15ULL}
: size_t{0x9e3779b9UL};
GCC reports:
error: narrowing conversion of ‘11400714819323198485’ from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} [-Wnarrowing]
The conditional expression is valid conceptually, but the 64-bit braced initializer is still diagnosed as narrowing when size_t is 32-bit.
Reproducer
Build v0.0.2 on i586 with the normal openSUSE optimization flags and C++20 enabled.
Proposed direction
Use explicit casts or architecture-conditional definitions so both constants are well-formed for 32-bit and 64-bit size_t, for example:
constexpr size_t kGolden = sizeof(size_t) == 8
? static_cast<size_t>(0x9e3779b97f4a7c15ULL)
: static_cast<size_t>(0x9e3779b9UL);
The openSUSE package currently carries this as a downstream patch.
- Dominant language
- C++
- Stars
- 423
- Forks
- 53
- Avg merge
- 19h 7m
- Merged PRs (30d)
- 337
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mudler/vllm.cpp
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
sync(UPSTREAM-SYNC-HEADPIN): step6-c1a credits the version read to a job whose own read returned 1 Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
test_cpu_x86_llamacpp_floor reds as a function of machine load, on branches that never touched it Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·