-
-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathCargo.toml
More file actions
114 lines (102 loc) · 5.08 KB
/
Copy pathCargo.toml
File metadata and controls
114 lines (102 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
cargo-features = ["codegen-backend"]
[workspace]
resolver = "2"
members = ["crates/*"]
# lobby-worker/broker-wasm is a standalone wasm32 artifact (Cloudflare Worker
# Durable Object brain). Excluded so the native workspace build / Tilt clippy
# never compile it for the host target — it is built only via wasm-bindgen.
exclude = ["client/src-tauri", "lobby-worker/broker-wasm"]
[workspace.package]
version = "0.47.0"
license = "MIT OR Apache-2.0"
[workspace.dependencies]
serde = { version = "1", features = ["derive", "rc"] }
tracing = "0.1"
[workspace.metadata.release]
shared-version = true
tag-name = "v{{version}}"
tag-message = "v{{version}}"
pre-release-commit-message = "release: v{{version}}"
pre-release-replacements = [
{ file = "../../client/package.json", search = '"version": "[^"]*"', replace = '"version": "{{version}}"' },
{ file = "../../client/src-tauri/tauri.conf.json", search = '"version": "[^"]*"', replace = '"version": "{{version}}"' },
{ file = "../../client/src-tauri/Cargo.toml", search = '^version = "[^"]*"', replace = 'version = "{{version}}"' },
# client/src-tauri is its OWN cargo workspace, so bumping its Cargo.toml above leaves its
# Cargo.lock pinning the previous version. The Tauri CI job builds with `cargo check --locked`,
# which then refuses to update the lock and fails — and because tauri-check is a `needs:` of the
# required "Rust (fmt, clippy, test, coverage-gate)" aggregator, that reds main and every
# merge-group ref built on the release commit. v0.35.2 shipped exactly that way (fixed in #6568).
# The two-line anchor keeps this from matching any other package's version; cargo-release's
# default min=1 makes a lockfile format change fail the release loudly instead of silently.
# The newline lives in a capture group, never in the replacement: the regex crate expands only
# ${1}-style references in a replacement, so a literal \n there would be inserted verbatim and
# would splice the two lines together.
{ file = "../../client/src-tauri/Cargo.lock", search = '(name = "phase-tauri"\nversion = )"[^"]*"', replace = '${1}"{{version}}"' },
]
publish = false
[profile.dev]
opt-level = 0
debug = "line-tables-only"
split-debuginfo = "unpacked"
# mimalloc is the `#[global_allocator]` of every native binary in `crates/phase-ai/
# src/bin/` — the motivating pair is `ai_gate.rs` / `ai_perf_gate.rs`, but all of them
# pick this up. Its entire C core is one unity translation unit
# (`libmimalloc-sys-*/c_src/mimalloc/v3/src/static.c`) and inherits `profile.dev`'s
# `opt-level = 0`, so every allocation in a debug gate run walks an unoptimized malloc.
# Measured on the linked artifact:
# readelf --debug-dump=info target/debug/ai-gate | grep -A1 'GNU C23'
# reported `-O0` for exactly that file before this override and `-O2` after it.
# This override is still not *provably* payload-neutral, but the one known
# mechanism is now closed. The AI used to read the wall clock on its live decision
# path: `phase-ai/src/projection.rs` bailed a projection after a 15 ms wall-clock
# budget, and — unlike `search.rs`'s and `planner/mod.rs`'s deadlines — that
# budget was the one still missing the measurement-mode carve-out, so a faster
# allocator let more projections finish and could change a target, a board, a
# winner and every counter downstream. That is fixed:
# `projection::projection_deadline` returns `Deadline::none()` under
# `ExecutionMode::Measurement`, mirroring the other two, so the gates' payloads no
# longer contain a decision-affecting wall-clock read that allocation speed can
# move. What remains host-variable on the measurement path is `RandomState`
# iteration order (#4878), which is seeded from OS randomness, not allocation
# addresses. This block is kept because the obvious "allocator changes are
# invisible" claim was false once and the record is worth more than a clean claim.
# Scoped to the one package so nothing else loses debug fidelity.
[profile.dev.package.libmimalloc-sys]
opt-level = 2
[profile.test]
inherits = "dev"
codegen-units = 256
[profile.wasm-dev]
inherits = "dev"
opt-level = 2
codegen-backend = "llvm"
[profile.release]
opt-level = 'z'
lto = true
codegen-units = 1
strip = true
panic = 'abort'
# Native server: speed over size, unwind so tokio catches per-task panics.
# Overrides release's fat LTO + single codegen unit (those exist for WASM
# binary size, not native servers): they pushed the Windows release build to
# ~34 min against the 35-min CI timeout, cancelling the daily release. Thin LTO
# keeps cross-crate inlining at a fraction of the compile cost, and 16 codegen
# units parallelize the build.
[profile.server-release]
inherits = "release"
opt-level = 2
lto = "thin"
codegen-units = 16
panic = 'unwind'
# CLI tools (oracle-gen, coverage-report): fast compile, decent runtime
[profile.tool]
inherits = "dev"
opt-level = 1
codegen-backend = "llvm"
# Profiling: native-optimized like server-release, with debug info retained
# so samply/flamegraph attribute samples to real symbols.
# Usage: cargo build --profile profiling --bin ai-bench-state
[profile.profiling]
inherits = "server-release"
debug = "line-tables-only"
strip = false