Skip to content

Fix quality-score link after streaming refactor#434

Open
andreaborio wants to merge 1 commit into
antirez:mainfrom
andreaborio:fix/quality-score-link
Open

Fix quality-score link after streaming refactor#434
andreaborio wants to merge 1 commit into
antirez:mainfrom
andreaborio:fix/quality-score-link

Conversation

@andreaborio

Copy link
Copy Markdown

What

make -C gguf-tools quality-score fails to link on current main (80ebbc3).

The streaming refactor made ds4.o depend on ds4_distributed.o
(ds4_session_*ds4_dist_session_*) and ds4_ssd.o
(ds4_engine_open/closeds4_ssd_*), but the quality-score target still
links only ds4.o plus the backend object. The link fails with undefined
ds4_dist_* / ds4_ssd_* symbols on both the Metal and CUDA branches, and no
score_official binary is produced.

Fix

Add ds4_distributed.o and ds4_ssd.o to QUALITY_TARGETS and QUALITY_OBJS
on both branches, matching the CORE_OBJS set that ds4 and ds4-server
already link.

Reproduce / testing (per CONTRIBUTING.md)

Build-only change to a tools target; no inference backend source is touched, so
the correctness (ds4_test) and speed (ds4-bench) regression tracks are not
affected by this change. The failure mode it addresses is the broken link.

Machine / backend: macOS, Metal, Apple M5 Pro.

Before:

$ make -C gguf-tools quality-score
...
ld: Undefined symbols for architecture arm64:
  "_ds4_dist_session_create", referenced from: _ds4_session_create in ds4.o
  "_ds4_ssd_cache_experts_for_byte_budget", referenced from: _ds4_engine_open in ds4.o
  "_ds4_ssd_memory_lock_acquire", referenced from: _ds4_engine_open in ds4.o
  ... (ds4_dist_* and ds4_ssd_*)
clang: error: linker command failed with exit code 1
make: *** [quality-score] Error 1

After:

$ make -C gguf-tools quality-score
cc -I.. -o quality-testing/score_official quality-testing/score_official.c \
   ../ds4.o ../ds4_distributed.o ../ds4_ssd.o ../ds4_metal.o \
   -lm -pthread -framework Foundation -framework Metal
$ ls gguf-tools/quality-testing/score_official     # built

CUDA branch changed symmetrically but not built here (no CUDA box). It
mirrors the CUDA CORE_OBJS already used to build ds4-server, so it should
link there too — worth a confirm on a CUDA machine.

Scope

Only the two existing Makefile branches (Metal, CUDA). ROCm quality-score
wiring is pre-existing / separate and left untouched.

The streaming refactor made ds4.o depend on ds4_distributed.o and
ds4_ssd.o: ds4_session_* call ds4_dist_session_*, and ds4_engine_open/
close call ds4_ssd_*. The gguf-tools quality-score target still links
only ds4.o plus the backend object, so `make -C gguf-tools quality-score`
fails at link time on both the Metal and CUDA branches with undefined
ds4_dist_*/ds4_ssd_* symbols and no scorer is produced.

Add ds4_distributed.o and ds4_ssd.o to QUALITY_TARGETS and QUALITY_OBJS
on both branches, matching the CORE_OBJS set that ds4 and ds4-server
already link.

Build-only change, no backend source touched, so the correctness
(ds4_test) and speed (ds4-bench) tracks are unaffected.

Tested on macOS / Metal (Apple M5 Pro):
  make -C gguf-tools quality-score
  before: ld: undefined symbols ds4_dist_*/ds4_ssd_*, no binary
  after:  links and builds gguf-tools/quality-testing/score_official
CUDA branch changed symmetrically but not built here (no CUDA box); it
mirrors the working CUDA CORE_OBJS.
@andreaborio andreaborio force-pushed the fix/quality-score-link branch from 2f87fdd to 3660153 Compare June 17, 2026 09:58
andreaborio pushed a commit to andreaborio/ds4 that referenced this pull request Jun 18, 2026
Makefile: link ds4_distributed.o/ds4_ssd.o (broken after streaming refactor; also upstream PR antirez#434). score_official.c: enable SSD streaming (40 GiB cache) so it runs on a 64 GB box. FORK_NOTES.md: upstreamability map (per-expert NOT mergeable under antirez's no-speed-regression rule).
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.

1 participant