Repository navigation
build: native target-cpu by default, debug 0 everywhere - #1505
Conversation
.cargo/config.toml now defaults to `-Ctarget-cpu=native`, as ndarray's has since 2026-09-16: a default that names a tier the host is not grades the wrong tier silently (a cost probe here reported AVX2 timings on an AVX-512 host). `.cargo/config-v3.toml` is the portable baseline for anything shipped. It also sets `[profile.dev]` and `[profile.test]` `debug = 0`. Root Cargo.toml already had dev debug 0, but 19 crates are their own workspace and built with debug info; a config-file profile reaches them all. Measured on lance-graph-glove-parity, no env overrides: before `debuginfo=2 target-cpu=x86-64-v3`, after `target-cpu=native` and no debuginfo. CI: unchanged tier (every workflow sets RUSTFLAGS with an explicit v3, which replaces config rustflags); the four workflow-level `-C debuginfo=1` become 0, matching the job-level overrides. Dockerfiles that copy this tree or build from it (hhtld, cognitive-stack, symbiont, both thinking-engine) pin `RUSTFLAGS=-C target-cpu=x86-64-v3` in their builder stage, so an image stays portable. The two thinking-engine images did not copy `.cargo` at all and so built at generic x86-64 (SSE2), the arm the config measures as slower than scalar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (11)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cfc8453ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review fixes (Codex on #1505): - P2: a global `ENV RUSTFLAGS="-C target-cpu=x86-64-v3"` hands an x86 CPU name to the aarch64 compiler on Dockerfile.hhtld's documented arm64 build. The three images that copy the tree now replace .cargo/config.toml with config-v3.toml, which only applies to x86_64. The two thinking-engine images, which copy no .cargo, use CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS, their only flag source and x86_64-only. - P1: `make publish` (maturin, from python/) would build a native-tuned wheel tagged for generic x86_64. It now sets a portable RUSTFLAGS on an x86_64 host only. Measured on lance-graph-glove-parity under the native default: the per-target variable is joined with the config entry and `native` lands last, so it does not pin a build that sees the config (hence the file replacement for the copying images); `--config .cargo/config-v3.toml` appends `-Ctarget-cpu=x86-64-v3` last, which does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Summary
.cargo/config.tomlnow defaults to-Ctarget-cpu=native. ndarray has used this default since 2026-09-16. With a default that names a tier the host is not, every faster-tier measurement needs an extra flag, and a forgotten flag doesn't fail — it measures the wrong tier. Here, the D-CMH-1 cost probe (#1504) reported AVX2 timings on an AVX-512 host, and nothing in its output said so.New
.cargo/config-v3.tomlis the portable AVX2 baseline, for anything shipped.[profile.dev]and[profile.test]now setdebug = 0. The rootCargo.tomlalready set dev debug to 0, but 19 crates are their own workspaces and never saw it. A profile in the config file reaches every build started under this tree.Evidence
On
lance-graph-glove-parity(a standalone workspace),cargo build -vwith no environment overrides:-C debuginfo=2 -C target-cpu=x86-64-v3-C target-cpu=native, no debuginfoThe method tests pass under the new config (10/10).
What else changes
RUSTFLAGSwith an explicit-C target-cpu=x86-64-v3, which replaces the config file's flags. The four workflow-level-C debuginfo=1settings become0, matching the job-level overrides that were already 0. Debug logging is still available through GitHub's rerun option.Dockerfile.hhtld,crates/cognitive-stack,crates/symbiont, and bothcrates/thinking-engineDockerfiles now pinENV RUSTFLAGS="-C target-cpu=x86-64-v3"in their builder stage, so their images stay portable.DockerfileandDockerfile.avx512already pinned their own tier..cargo. They were building at generic x86-64 (SSE2), the tier the config itself measures as slower than scalar code. They now build at v3.Not changed
d-diamond-1-probekeepsdebug = 1for release).config-native.tomlandconfig-avx512.tomlare kept.config-native.tomlis now the same as the default on x86_64.🤖 Generated with Claude Code
https://claude.ai/code/session_011BMJnDBAfzcuQh5HeT39Rh
Generated by Claude Code
Summary by CodeRabbit