Skip to content

build: native target-cpu by default, debug 0 everywhere - #1505

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-9f3b8075-74u47l-native-default
Oct 12, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-9f3b8075-74u47l-native-default

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

.cargo/config.toml now 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.toml is the portable AVX2 baseline, for anything shipped.

[profile.dev] and [profile.test] now set debug = 0. The root Cargo.toml already 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 -v with no environment overrides:

config rustc flags
before -C debuginfo=2 -C target-cpu=x86-64-v3
after -C target-cpu=native, no debuginfo

The method tests pass under the new config (10/10).

What else changes

  • CI: the SIMD tier is unchanged. Every workflow sets RUSTFLAGS with an explicit -C target-cpu=x86-64-v3, which replaces the config file's flags. The four workflow-level -C debuginfo=1 settings become 0, matching the job-level overrides that were already 0. Debug logging is still available through GitHub's rerun option.
  • Dockerfiles: Dockerfile.hhtld, crates/cognitive-stack, crates/symbiont, and both crates/thinking-engine Dockerfiles now pin ENV RUSTFLAGS="-C target-cpu=x86-64-v3" in their builder stage, so their images stay portable. Dockerfile and Dockerfile.avx512 already pinned their own tier.
  • Existing fix: the two thinking-engine images never copied .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

  • Release profiles stay per crate (e.g. d-diamond-1-probe keeps debug = 1 for release).
  • config-native.toml and config-avx512.toml are kept. config-native.toml is 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

  • Build Improvements
    • Distributed and container builds now use a consistent x86-64-v3 CPU baseline.
    • Build and test workflows disable debug information, reducing generated artifact size.
    • Local builds use CPU-specific settings based on the build machine by default.

.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
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: a70a15de-1ad3-48ce-aab4-d5d8c30f8b3d

📥 Commits

Reviewing files that changed from the base of the PR and between ec3fee7 and 5cfc845.


📒 Files selected for processing (11)
  • .cargo/config-v3.toml
  • .cargo/config.toml
  • .github/workflows/build.yml
  • .github/workflows/rust-publish.yml
  • .github/workflows/rust-test.yml
  • .github/workflows/style.yml
  • Dockerfile.hhtld
  • crates/cognitive-stack/Dockerfile
  • crates/symbiont/Dockerfile
  • crates/thinking-engine/Dockerfile
  • crates/thinking-engine/Dockerfile.railway

 _________________________________________
< Time zones: the final boss of software. >
 -----------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 12, 2026 16:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T16:39:31.272710Z 5cfc845 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .cargo/config.toml
Comment thread Dockerfile.hhtld Outdated
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
@AdaWorldAPI
AdaWorldAPI merged commit c8686a0 into main Oct 12, 2026
7 checks passed
AdaWorldAPI added a commit that referenced this pull request Oct 13, 2026
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