Repository navigation
app: control vector picker and strength in Engine advanced - #1951
BlivionIaG wants to merge 55 commits into
Conversation
|
CI is green on The first run's |
1459509 to
0e196a7
Compare
|
Final app head is now Terminal platform-check snapshot at unchanged Maintainer follow-up #1951 (comment) assigns review to the desktop-app maintainers,not the engine maintainers. This app-only PR remains dependent on--glp from#1835 and cannot land before it. No merge/auto-merge/draft-state change;awaiting app-maintainer review. Currentb71e73e2 stays unchanged. |
|
Thanks @BlivionIaG. This PR changes only the desktop app, plus its CHANGELOG line, and the app has its own maintainers, so they'll review it rather than us. On the engine side it needs
|
b71e73e to
334b7c2
Compare
|
Rebased onto main |
334b7c2 to
46eb6b8
Compare
The reader implements the GLP format defined by the weightless project (@msuiche): a GGUF v3 container of one fp32 direction per layer, applied by adding it to the residual stream. A file with no mode is llama.cpp's additive vector; a file that names any other mode, project included, is refused rather than read as an add file. The reader also refuses a spec version, rank or hook point it does not implement, a layer named twice, a direction that is not finite, and a digest that does not match. It reports the SHA-256 of the exact bytes it was handed, so a caller can name the file it loaded. tf-glp-check shows the reader's view of a file for glp_parity.py to compare with the reference reader, the file hash included.
…8-27B A steered layer takes the dispatch an unsteered layer takes: the norm that adds the block's output to the residual stream also adds alpha times the layer's direction to the row, and the normalisation reads the result. The plan holds one device buffer per layer the vector names, and a model without one runs the plain norm. The steered norm clears the half-operand state the plain norm leaves for the head, since its output has no such words. The kernel contract has a float64 reference for the add, a bound for the kernel's own fp32 product and sum, the launch's threads and threadgroup memory for gate 5, and the GPU suite with a control that drops a NaN and one that breaks the normalisation. The GPU half needs a Mac.
Off unless --glp is given: without it the server is as it was. The file is read once at startup, before the model loads, and the startup line names the file (escaped), the SHA-256 of its exact bytes and that replies are steered, beside the strength, the layers and the checkpoint the vector came from. The file hash is taken over the bytes already read; nothing is read twice. A file the reader refuses, a width or base model that does not match the checkpoint, a layer past the checkpoint's depth, a Gemma checkpoint, any other family, and a CUDA or ROCm backend are all refused by name and the server does not start. The engine reports the vector in force with the same file hash. docs/control-vectors.md covers the format, the layer a direction names, the refusals and how an operator brings a vector; the repository ships none.
…ry as the compiler allocates it
|
Commit identity fixed: author and committer on all 6 commits are now |
|
The change does what it describes: an opt-in file-and-strength control in the advanced engine settings, off by default, active only when the engine advertises the steering flags, with just the on/off state and strength written to audit records rather than the chosen file. The new host test of the setting behaviour is thorough, covering strength validation, refusal on an engine without support, picker-only file selection, restarting when the strength or file changes, persistence across a restart, and dropping a file that has since gone away. What is missing is coverage at the IPC boundary. The change deletes the host assertions that every engine channel is role-gated, that private material such as credentials, lesson text, environment values and folder paths never reaches audit logs or events, that the native picker is the sole admission route for a path, and that the bridge exposes each channel. They are removed rather than re-expressed against the reorganised modules, and nothing behavioural replaces them, so those invariants, including on the new control-vector channels, no longer have a host test. Please restore them as behavioural IPC tests and add an explicit check that the chosen vector path is never audited and that each new channel requires the operator role. Nothing here changes the engine, server or kernel; the new launch flags only become meaningful once the separate backend work lands. Size, comment-length and environment-access rules all hold. On balance this needs fixes for the deleted IPC security coverage, though the feature itself is sound.
|
|
Added
Checked on a clean |
|
Thanks @BlivionIaG. The new tests exercise the real IPC handlers and restore the role, audit privacy, picker-only path and preload coverage, including the four new channels. That answers our latest code request. What remains is #1835, which this depends on, and fitting it to current main's locale and preload changes.
|
Main's SenseNova support turned the qwen27 norm into normShift and filled quant_gpu.zig to its 600-line limit. The steered norm now dispatches from norm_steer_gpu.zig with its pipeline held by the steering plan, unsteered norms call main's normShift, and SenseNova models refuse a control vector.
|
Merged the new #1835 head ( |
Metal contracted hv + alpha * d in the steered norm into one fused multiply-add. At strengths whose products round (0.1, 0.3) that differs in the bf16 stream from the separately ordered reference the contract declares; powers of two were exact either way, and the GPU suite ran only at 1.0. The kernel now turns contraction off, and the suite checks the steered row bit for bit against the separately rounded add at 0.1 and 0.3 on rows built to sit on a bf16 tie, with a planted contracted kernel that must differ in every element.
|
Thanks, @BlivionIaG. The picker queue fix, overlapping strength/state regression and IPC coverage remain intact. The app code is unchanged from the previously tested subtree, and the latest app checks are useful. Desktop-maintainer approval and the steering parent landing first remain prerequisites. Packaged Electron checks and the parent's exact off-path and same-setting serial steering comparisons are still needed. The changelog is the only conflict with current main.
|
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # zig/src/native/metal.zig # zig/src/native/qwen27_served.zig
# Conflicts: # CHANGELOG.md
|
Merged #1835's refreshed head (upstream/main plus the open-options merge); no change to this PR's diff. Head |
|
Thank you, @BlivionIaG. The picker now uses the same serialized feature-change queue as set and clear. The overlap regression proves that a pending strength change and a pending enabled-state change both survive a file selection. Controls remain disabled by default, and the IPC coverage is intact. One small source fix remains: the added comment at The only current-main conflict is the changelog, which can be resolved during integration without another author rebase. Desktop approval, the steering parent landing first, packaged desktop validation and the parent's exact engine comparisons remain prerequisites. CHANGES REQUESTED for the comment-width fix; the picker functionality itself is confirmed.
|
|
Thank you, @BlivionIaG. The role-check comment is now within the width limit. The picker still uses the same serialized change queue as strength and on/off changes, and the overlap regression still checks the returned state and saved preferences. Steering remains off by default, and disabled or unsupported paths omit the engine arguments. The only conflict with current main is Desktop-maintainer approval and the steering parent landing first remain prerequisites. The smallest remaining check is one packaged Electron smoke using
|
|
Thank you. |
|
Thank you. Here is the packaged Electron smoke you asked for. Steps 2 to 6 pass against Full smoke reportResult: steps 2 to 6 pass in a packaged app against Setup
Packaging (the repo's own path) and the engine swapA packaged app only runs the engine inside its own bundle; the override env var is ignored once packaged. So the branch's engine was copied into the bundle and the bundle re-signed ad hoc. The release engine's Smoke-only patch (not in the PR): I applied a local patch to - if (!family || !weights || !floor) throw new Error(...)
+ const budget = /^([\d.]+) GiB at --context \d+/.exec(field('startup budget') ?? '')
+ if (!family || !weights || (!floor && !budget)) throw new Error(...)
...
- memoryFloorBytes: weightsBytes + Math.round(Number(floor[2]) * GIB),
+ memoryFloorBytes: floor ? weightsBytes + Math.round(Number(floor[2]) * GIB) : Math.round(Number(budget![1]) * GIB),How the app was run and driven
The vectorThe vector is synthetic. It is not derived from any behaviour, and it is not a refusal vector.
The app always pointed at the same path, Step checksEvery argv starts with
The security audit log has one What could not be done, and why
Findings
No defect in #1951's own code was found. I committed nothing and pushed nothing. |
|
Thank you @BlivionIaG for the detailed packaged smoke, including the explicit limits on what the The smoke exposed one integration issue that blocks the current app and steering engine One smaller UI correction belongs with the refusal rollback. At After those fixes, the remaining packaged checks are the two cells the smoke explicitly did not
|
|
Both asks are in at
Local: Still open from your list: the two packaged cells the earlier smoke could not run — step 1 through the real native picker, and choosing a new file while a vector is in force. Both need an unlocked session on this Mac; I will report them on this PR when I have them. |
What this changes
App controls for the generic add-only steering feature. Desktop-maintainer review and #1835 landing are still prerequisites.
6609ffbf99ef01fbdd3fc5513ff04400750decc4, merged into this head; Implement GLP control vectors with a fused Metal kernel for Qwen3.8-27B #1835 at24de2f6cb718e3f61e48dedb914267d0b13aed20is an ancestor. 36 commits ahead of main; merge conflicts wereCHANGELOG.mdandzig/build/qwen27_host.zig, both resolved keeping both sides.atc overlap --json: ATC0.9.6 was run against upstream with --base fb8fdf3; complete=false (myPullRequestsLimit, otherPullRequestsLimit, pullFilesLimit, pullFilesUnavailable, timeLimit). Supplemental complete snapshot:217foreign open heads,3038 exact local merge comparisons including latest Main ff742df; existing reviewed overlaps are retained, not claimed globally clean. The avoidable added environment-test collision with CUDA (GB10): a lending-daemon source for the display carveout, opt-in #2762 was removed by preserving Main's existing test name, without importing its unmerged feature.Checks on this head
c176811e94ab205a695393c42cdb54cc24afb947.app/andCHANGELOG.md), so the Zig findings are main's.app/on this head (Node 22.23.2, npm 10.9.8):npm ci --ignore-scripts,npm --prefix mobile ci --ignore-scripts,npm test(904/904 test files pass),npm run typecheck(0 errors) andgit diff --checkall pass. New regression: a picker selection overlapping a pending alpha change and a pending enabled change keeps both (red before the fix:alpha 2 !== 5, thenenabled true !== false).Receipt
c176811e94ab205a695393c42cdb54cc24afb947; Node 22.23.2, npm 10.9.8, Apple Silicon macOS. No model or GPU is used by the app checks.Remaining maintainer requests
Desktop-maintainer review; cannot land before #1835.
Checklist
Historical source-bound notes — not current-head qualification
Earlier commands/measurements retain their original commit/binary scope. Any earlier readiness or provenance claim is superseded by the open gates above.
Add-only operator control vectors
--glpfrom Implement GLP control vectors with a fused Metal kernel for Qwen3.8-27B #1835 and cannot land before it.Published head
46eb6b8c858b2f57653413dd35057475a035eb9aon main6c5cef8941b27d86b06a986834e13deb9b515e1e; follows backend #1835 atccac1b8337276e3e69118dcae97d1eeafe07d477(separate PRs, not a claim of ancestry).Settings → Engine advanced offers an operator-selected vector file and strength, off by default and gated by the engine's advertised
--glpsupport. Copy describes non-refusal style/topic steering, additive vectors only, named project/malformed refusals and the engine's exact-file SHA startup disclosure. No directional-ablation selector, refusal-removal assets or receipt/download links remain. The preview fixture is neutralstyle-vector.gguf; strength is described as scaling the added direction, not as an unverified derivation multiplier. All12 locale packs and the source phrases are updated.The contribution check exposed inherited large files touched by integration. Engine service responsibilities and engine/composer IPC groups are now composed into bounded modules: service585lines, preload600; channels, signatures, unsubscribe ownership, shutdown order and cache-cleanup admission are retained. The installed-view admission regression failed during extraction; the original service seam was restored and the unchanged consumer scenario now passes.
Exercised qualification
Execution scope: production bundle, six consumer suites and real native1.2.5 compatibility smoke were executed at initial
0e196a7b32eef3b573f5b8f4b607217869dbc924. The current46eb6b8c858b2f57653413dd35057475a035eb9ais tests-only: retained input-validation suite, typecheck and contribution preflight pass. Those earlier runtime executions are not relabelled as new runs. The web preview was exercised earlier in this pass, not rerun after the tests-only correction.Open gates
Desktop-maintainer review, and #1835 landing first (its own device runs are the maintainer's). No packaged Electron or model-performance receipt is claimed.
CI correction: the old desktop check asserted IPC literal text remained in preload.ts. Those implementation-text, wiring-count and browser mock-echo assertions are deleted, not repinned to the new modules. Actual production input-validation cases remain and pass; typecheck passes. This is a tests-only descendant, not a new runtime measurement. Current b71 CI: desktop-linux and appimage-linux pass; macOS desktop855/856cases pass, with only the unchanged inherited bot-VM bounded-output EPERM. The failing job did not record its syscall/stack; no isolation weakening, skip or retry was introduced. All other platform checks passed; the inherited desktop failure and device gates remain open.
CI on the current head: 12 successful checks and 2 scheduled-only skips,
desktopanddesktop-linuxincluded.