There was no slow flag to remove: the release profile was Cargo's default, and that default turns incremental compilation off. With one crate this large, that makes every rebuild a full rebuild. Measured on an idle machine: one-line source edit, rebuild 24.97s -> 1.67s cold build 24.02s -> 23.37s 300 corpus modules x4 translated 46.6s -> 46.2s So the edit-rebuild loop gets ~15x shorter, and neither the cold build nor translation throughput moves. The throughput figure is repeatable to within 0.5s run to run, so the per-translation budget in AGENTS.md is untouched. Profiles only apply from the workspace root, so this changes how the repo builds itself and nothing about how a consumer builds the published crate.
87 lines
2.8 KiB
TOML
87 lines
2.8 KiB
TOML
[workspace]
|
|
members = ["validation"]
|
|
resolver = "2"
|
|
|
|
[package]
|
|
name = "metal2vulkan"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
rust-version = "1.87"
|
|
license = "LGPL-3.0-or-later"
|
|
authors = ["Anees Iqbal <hello@aneesiqbal.ai>"]
|
|
description = "Translate Metal AIR / LLVM IR to Vulkan SPIR-V with a native Rust emitter"
|
|
readme = "README.md"
|
|
repository = "https://github.com/steelbrain/metal2vulkan"
|
|
homepage = "https://github.com/steelbrain/metal2vulkan"
|
|
documentation = "https://docs.rs/metal2vulkan"
|
|
keywords = ["metal", "air", "spir-v", "vulkan", "gpu"]
|
|
categories = ["compilers", "graphics", "encoding"]
|
|
# crates.io ships only this product crate (lib + bin + unit/integration tests under
|
|
# src/ and tests/). Workspace member `validation/`, private harvest/corpus, scripts,
|
|
# and docs stay out of the published tarball.
|
|
exclude = [
|
|
"/.github/",
|
|
"/docs/",
|
|
"/scripts/",
|
|
"/validation/",
|
|
"/validation/**",
|
|
"/target/",
|
|
"Cargo.lock",
|
|
"tests/fixtures/",
|
|
"m2v-old",
|
|
"**/*.air",
|
|
"**/*.metallib",
|
|
"**/*.mtlb",
|
|
"**/*.spv",
|
|
"**/*.spvasm",
|
|
]
|
|
|
|
[[bin]]
|
|
name = "metal2vulkan"
|
|
path = "src/main.rs"
|
|
required-features = []
|
|
|
|
[[example]]
|
|
name = "translate_reflected"
|
|
path = "examples/translate_reflected.rs"
|
|
required-features = ["serde"]
|
|
|
|
[lib]
|
|
name = "metal2vulkan"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
# Grammar-derived SPIR-V enums at the locked 1.4.341 revision.
|
|
spirv = "0.4.0"
|
|
# Bound every external-tool spawn (llvm-dis / spirv-val / …) so a stuck tool cannot hang us.
|
|
wait-timeout = "0.2"
|
|
# Optional: persistable ShaderReflection + CLI `--emit-meta` JSON.
|
|
serde = { version = "1", features = ["derive"], optional = true }
|
|
serde_json = { version = "1", optional = true }
|
|
|
|
[features]
|
|
default = []
|
|
# Derive Serialize/Deserialize on public reflection types and enable the CLI `--emit-meta` dump.
|
|
serde = ["dep:serde", "dep:serde_json"]
|
|
|
|
[dev-dependencies]
|
|
serde_json = "1"
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
# Cargo's default release profile turns incremental compilation OFF, which means every rebuild of
|
|
# this crate is a full rebuild of all ~262k lines of it. That is the whole cost: measured on an idle
|
|
# machine, a one-line source edit cost 24.97s to rebuild without incremental and 1.67s with it.
|
|
#
|
|
# It buys that back for nothing measurable. A cold build is unchanged (23.4s incremental vs 24.0s
|
|
# not), and translation throughput is unchanged: 300 corpus modules translated four times each took
|
|
# 46.2s incremental against 46.6s not, run to run repeatable to within 0.5s. The 20-second/500 MiB
|
|
# per-translation contract in AGENTS.md is unaffected.
|
|
#
|
|
# Profile settings only apply to builds whose workspace root this is, so this changes how the repo
|
|
# builds itself and nothing about how a consumer builds the published crate.
|
|
[profile.release]
|
|
incremental = true
|