Skip to content

Remove server.py and LUCEBOX_SERVER_BACKEND; use dflash_server directly - #282

Merged
davide221 merged 5 commits into
Luce-Org:mainfrom
howard0su:server_remove
May 27, 2026
Merged

davide221 merged 5 commits into
Luce-Org:mainfrom
howard0su:server_remove

Conversation

@howard0su

Copy link
Copy Markdown
Contributor
  • Delete server/scripts/server.py (2973 lines, replaced by native C++ server)
  • Update all shell/Python invocation sites to spawn dflash_server binary
  • Remove LUCEBOX_SERVER_BACKEND env var (single backend now)
  • Remove DFLASH_BIN variable (no longer needed without --bin flag)
  • Add --url flag to test_server_prefix_cache.py and test_multi_turn_prefix_cache.py so they can run against an already-running server without spawning a subprocess
  • Fix BIN -> SERVER_BIN bug in bench_agent_loop.py
  • Clean up all documentation and C++ source comments

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

4 issues found across 31 files

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="optimizations/pflash/README.md">

<violation number="1" location="optimizations/pflash/README.md:108">
P1: README server launch command uses wrong build directory path (`./build/dflash_server` instead of `./server/build/dflash_server`)</violation>
</file>

<file name="server/scripts/test_multi_turn_prefix_cache.py">

<violation number="1" location="server/scripts/test_multi_turn_prefix_cache.py:144">
P2: Flakiness regression: server log is read before the spawned server is stopped, so cache-hit lines may be missing from the log due to unflushed buffers, causing spurious `deeper_ok = False` failures.</violation>

<violation number="2" location="server/scripts/test_multi_turn_prefix_cache.py:187">
P2: --url mode silently skips the primary cache-depth correctness gate, allowing false passes</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

```bash
python server/scripts/server.py \
--target server/models/Qwen3.6-27B-Q4_K_M.gguf \
./build/dflash_server server/models/Qwen3.6-27B-Q4_K_M.gguf \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: README server launch command uses wrong build directory path (./build/dflash_server instead of ./server/build/dflash_server)

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At optimizations/pflash/README.md, line 108:

<comment>README server launch command uses wrong build directory path (`./build/dflash_server` instead of `./server/build/dflash_server`)</comment>

<file context>
@@ -105,10 +105,9 @@ For an OpenAI-compatible server with transparent compression on long prompts, ru
 ```bash
-python server/scripts/server.py \
-  --target server/models/Qwen3.6-27B-Q4_K_M.gguf \
+./build/dflash_server server/models/Qwen3.6-27B-Q4_K_M.gguf \
   --draft  server/models/draft/model.safetensors \
-  --max-ctx 8192 --budget 16 --fa-window 0 \
</file context>

Comment thread server/eval/README.md Resolved
t5, r5 = turn(history, "Q5: what is the speed of light?")
print(f"latency={t5:.2f}s reply={r5!r}", flush=True)

# Parse server log for cache-hit lines (only available when we spawned).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: Flakiness regression: server log is read before the spawned server is stopped, so cache-hit lines may be missing from the log due to unflushed buffers, causing spurious deeper_ok = False failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At server/scripts/test_multi_turn_prefix_cache.py, line 144:

<comment>Flakiness regression: server log is read before the spawned server is stopped, so cache-hit lines may be missing from the log due to unflushed buffers, causing spurious `deeper_ok = False` failures.</comment>

<file context>
@@ -25,190 +27,185 @@
+    t5, r5 = turn(history, "Q5: what is the speed of light?")
+    print(f"latency={t5:.2f}s  reply={r5!r}", flush=True)
+
+    # Parse server log for cache-hit lines (only available when we spawned).
+    hit_lines = []
+    if spawned:
</file context>

deeper_ok = False
print(f"\n WARNING: expected ≥4 hit log lines (turns 2..5), got {len(hit_lens)}")
else:
# Can't verify without server logs; skip this gate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: --url mode silently skips the primary cache-depth correctness gate, allowing false passes

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At server/scripts/test_multi_turn_prefix_cache.py, line 187:

<comment>--url mode silently skips the primary cache-depth correctness gate, allowing false passes</comment>

<file context>
@@ -25,190 +27,185 @@
+        deeper_ok = False
+        print(f"\n  WARNING: expected ≥4 hit log lines (turns 2..5), got {len(hit_lens)}")
+    else:
+        # Can't verify without server logs; skip this gate.
+        deeper_ok = True
+
</file context>

howard0su and others added 5 commits May 27, 2026 11:41
- Delete server/scripts/server.py (2973 lines, replaced by native C++ server)
- Update all shell/Python invocation sites to spawn dflash_server binary
- Remove LUCEBOX_SERVER_BACKEND env var (single backend now)
- Remove DFLASH_BIN variable (no longer needed without --bin flag)
- Add --url flag to test_server_prefix_cache.py and
  test_multi_turn_prefix_cache.py so they can run against an
  already-running server without spawning a subprocess
- Fix BIN -> SERVER_BIN bug in bench_agent_loop.py
- Clean up all documentation and C++ source comments

Co-authored-by: Copilot <[email protected]>
These files imported from or were only used by the deleted server.py:
- test_server.py: unit tests for server.py's Python functions
- test_prefix_cache.py: prefix cache tests using server.py's build_app
- prefix_cache.py: Python prefix cache (only imported by test_prefix_cache)
- _prefill_hook.py: prefill hook (only imported by test_prefix_cache)
- placement/server_resolver.py: placement logic (only imported by server.py)

Update DEVELOPER.md to remove references to deleted files.

Co-authored-by: Copilot <[email protected]>
The Python ToolMemory implementation is superseded by the C++ port in
server/src/server/tool_memory.{h,cpp}. The Python module had no remaining
consumers after server.py was deleted.

Co-authored-by: Copilot <[email protected]>
- uv.lock: fix source path 'dflash' → 'server' for lucebox-dflash
- server/pyproject.toml: remove fastapi and uvicorn (no Python consumers
  remain after server.py deletion)
- uv.lock: regenerated — drops fastapi, uvicorn, pydantic, starlette,
  and other transitive deps (7 packages removed)
- scripts/check_uv_workspace.sh: remove 'import server' (deleted) and
  fastapi/uvicorn import checks

Co-authored-by: Copilot <[email protected]>
test_server.py was deleted alongside server.py in this PR. The
remaining server/tests/*.py require live model weights and a running
dflash_server, so they don't belong in the no-GPU CI lane. C++
test_server_unit (ctest server_unit) still covers server logic.
@davide221
davide221 merged commit 2540f19 into Luce-Org:main May 27, 2026
2 checks passed
easel pushed a commit to easel/lucebox-hub that referenced this pull request May 27, 2026
Integrate the latest server.py removal PR head, including the CI cleanup that drops the deleted Python server test step.
davide221 added a commit to dusterbloom/lucebox-hub that referenced this pull request May 27, 2026
PR Luce-Org#282 renamed dflash/ -> server/ but README still referenced the old
path in 7 quickstart commands (cmake -S dflash, --directory dflash,
cd lucebox-hub/dflash). Users following the README would hit
'No such file or directory'. Sweep path-shaped references; leave
binary names (test_dflash, dflash_server), submodule branch
(luce-dflash), and prose mentions of the dflash algorithm as-is.
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.

2 participants