mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1212] Review: shared MTP head fix — sibling Q4 state omission and test configuration gaps #501
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#501
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @x00r on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1212
Focused shared MTP head review
Date: 2026-10-06
Verdict: concerns
Scope: current workspace diff in src/core/mtp.cpp, include/strata/core/mtp.hpp, CMakeLists.txt; new tests/core/mtp_shared_head_test.cpp; immediate callers and ownership paths. Read-only: no workspace changes, builds, or test execution.
Findings
Medium — existing sibling omission: shared slots lose Q4 projection state. src/core/mtp.cpp:275-288 copies dense_, experts_, tensors_ but not dense4_/q4_off_; src/core/mtp.cpp:194-198 therefore dispatches the slots through original Q8_0 projections. src/program/generate.cpp:3570 configures Q4 only on the owner, and :3583-3592 creates slots through shared load without carrying that state. With --mtp-q4 proj/all, solo and batch-slot drafting use different projection formats. The new bind-only test bypasses load and cannot catch this sibling omission. Follow-up: explicitly share Q4 projections and offsets with correct ownership (destructor :154 currently unconditionally frees dense4_), or explicitly disallow/document the combination. Do not merely copy the pointer. No change requested to the focused head patch.
Medium — new test is registered for builds that cannot execute its Q4 case. CMakeLists.txt:462-468 registers unconditionally for GPU builds; tests/core/mtp_shared_head_test.cpp:91,121-124 unconditionally executes the Q4 override case. With STRATA_NATIVE_EXPERTS=OFF, src/core/mtp.cpp:258-260 returns false from make_q4_head, so this test fails on a GPU despite a valid non-native build. Guard only the Q4 case by STRATA_NATIVE_EXPERTS or arrange appropriate configuration-specific registration. Also the new target ignores STRATA_BUILD_TESTS, as do existing adjacent file_expert_source_test/vmm_test (:451-460) and expert_profile_save_test (:470-475); do not silently expand that cleanup.
Low — inherited full-head diagnostic makes subset tests fail spuriously. tests/core/mtp_shared_head_test.cpp:91-92 expects subsets regardless of environment; src/core/mtp.cpp:470-472,644 honors STRATA_MTP_FULL_HEAD=1 and then leaves dhead_type_=-1. The Q5_K subset case consequently expects 13 and fails. CMakeLists.txt:467-468 does not sanitize the environment. Set STRATA_MTP_FULL_HEAD=0 for this test before its first bind (the switch is cached), or set a test-specific environment in CTest.
Ownership and comment audit
Evidence and residual risk
Executed: git status --short; git diff --stat; git remote -v; git diff -- CMakeLists.txt include/strata/core/mtp.hpp src/core/mtp.cpp; git diff --check (no diagnostics); gh --version; gh auth status; date +%F. Read the new test, header, relevant mtp.cpp/native_head.cpp/CMakeLists.txt/gguf_fixture.hpp sections. Searched dhead_type_/dvocab_host_/dense4_/q4_off_, bind callers, slot_mtp/set_q4 wiring, full_head_env/coupled setup, native/test configuration, and WeightTable parsing with the repository grep tool.
Findings are static control-flow evidence, not runtime reproductions. The new real-bind assertions structurally cover deletion of either production metadata-copy assignment, but neither test execution nor a reverted-call/assignment failure was performed: the user prohibits builds and workspace edits, and the CUDA build is running separately. Fix is NOT claimed runtime-verified. No CUDA/HIP run, mutation test, or full-project review performed. Check both copy removals after the independent build, then run the test with the fix and STRATA_MTP_FULL_HEAD=1 and with a native-experts-disabled GPU build when available.
@x00r commented on GitHub (Oct 6, 2026):
Disregard this! Experimental agents running away with things -_-
--aux-cpus: helper threads on spare CPUs, +10% decode on a layer split (Linux, opt-in) #3555