Skip to content

refactor(dflash): rename namespace dflash27b → dflash::common#241

Merged
davide221 merged 1 commit into
Luce-Org:mainfrom
dusterbloom:refactor/namespace-dflash-common
May 21, 2026
Merged

refactor(dflash): rename namespace dflash27b → dflash::common#241
davide221 merged 1 commit into
Luce-Org:mainfrom
dusterbloom:refactor/namespace-dflash-common

Conversation

@dusterbloom
Copy link
Copy Markdown
Contributor

@dusterbloom dusterbloom commented May 21, 2026

Scope clarification: This PR renames the C++ namespace dflash27bdflash::common. The C ABI (dflash/include/dflash27b.h, dflash27b_last_error(), DFLASH27B_* macros and env vars) is intentionally untouched — deferred to a follow-up. Running rg dflash27b will surface those C ABI references and is expected; they're listed under "Out of scope" below.

Summary

Mechanical rename of namespace dflash27bdflash::common per @weicj's review on #237. The legacy name baked the first backend (Qwen3-27B) into shared code; renaming removes the backend leak so future backends plug into a neutral namespace.

Scope

In:

  • namespace dflash27bnamespace dflash::common (all source + tests)
  • dflash27b::* qualified uses → dflash::common::*
  • CMake static library target dflash27bdflash_common
  • project(dflash27b)project(dflash)
  • Private CMake variables _dflash27b_*_dflash_*
  • Stale comments referencing the old namespace name

Out (deferred to a follow-up PR with backward-compat shims):

  • Public C header dflash/include/dflash27b.h (filename + header guard DFLASH27B_H)
  • C ABI symbol dflash27b_last_error()
  • Preprocessor macros DFLASH27B_* (build flags + compile-time switches)
  • Env vars DFLASH27B_* (runtime config)

These all sit on the public surface — renaming them in this PR would be an ABI break without a deprecation cycle. They get a dedicated follow-up.

Verification

  • rg 'dflash27b::' → zero hits outside the deferred public header
  • rg 'namespace dflash27b' → zero hits
  • rg 'using namespace dflash27b' → zero hits
  • Clean build green (full rebuild from empty dflash/build/)
  • nm libdflash_common.a → only N6dflash6common* mangling, no dflash27b symbols (apart from the intentional dflash27b_last_error C ABI)
  • Smokes: smoke_qwen3_forward + Qwen3-0.6B pass, test_flashprefill_kernels pass (4/4), test_kv_quant pass (T1–T4)
  • Diff is symmetric (insertions ≈ deletions — pure rename)

Build note for reviewers

CUDA 12.6 + GCC 13.3 has a known _Float128 conflict during CUDA host-compiler ID detection. If you hit it, add:

-DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-11

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 141 files

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

@dusterbloom dusterbloom marked this pull request as draft May 21, 2026 10:49
Comment thread dflash/test/test_flash_attn_sparse_mask.cpp Outdated
@dusterbloom dusterbloom force-pushed the refactor/namespace-dflash-common branch from 3961197 to 92d3647 Compare May 21, 2026 11:00
@dusterbloom dusterbloom marked this pull request as ready for review May 21, 2026 11:46
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 138 files

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.

Re-trigger cubic

Mechanical rename per @weicj's review on Luce-Org#237. Renames the legacy
backend-baked namespace to a neutral one so future backends plug into
shared code without name leakage.

Scope:
- namespace dflash27b → namespace dflash::common (sources + tests)
- dflash27b::* → dflash::common::*
- CMake static lib dflash27b → dflash_common
- CMake project(dflash27b) → project(dflash)
- Private CMake vars _dflash27b_* → _dflash_*
- Stale comment references

Out of scope (deferred to a follow-up):
- Public C header dflash/include/dflash27b.h
- C symbol dflash27b_last_error()
- Preprocessor macros DFLASH27B_*
- Env vars DFLASH27B_*

Build note: CUDA 12.6 + GCC 13.3 has a known _Float128 conflict during
CUDA host-compiler ID detection. Workaround:
  -DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-11

No behavior change. Symbol mangling confirmed via nm as N6dflash6common*;
no residual dflash27b mangled symbols outside the deferred public C ABI.
@dusterbloom dusterbloom force-pushed the refactor/namespace-dflash-common branch from 92d3647 to fa34d31 Compare May 21, 2026 17:57
@davide221 davide221 merged commit 538bf53 into Luce-Org:main May 21, 2026
2 checks passed
dusterbloom added a commit to dusterbloom/lucebox-hub that referenced this pull request May 21, 2026
Per @howard0su's review on Luce-Org#237: gguf_mmap.h/.cpp are platform
abstraction (POSIX mmap / Windows MapViewOfFile) that will be reused
by multiple loaders. Extracting into a standalone PR ahead of the
loader refactor (target/draft/MTP heads all benefit).

Includes the cubic P1 fixes from f6e8e94:
- open() is now idempotent (releases prior mapping before re-opening,
  leaves object in default state on any failure path)
- Windows release() now calls CloseHandle() before clearing handle_

New: test_gguf_mmap unit test covers open/close, idempotency,
missing-file path, RAII destructor.

Stacked on Luce-Org#241 (uses dflash::common namespace from the start).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants