Skip to content

Deserialize README and license metadata in one pass - #2903

Draft
ww-oai wants to merge 3 commits into
mainfrom
codex/deserialize-build-metadata
Draft

ww-oai wants to merge 3 commits into
mainfrom
codex/deserialize-build-metadata

Conversation

@ww-oai

@ww-oai ww-oai commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Performance confirmation pending: results from the fixed confirmation pass with a baseline control are not yet available; assess the no-regression requirement using both data sets.

Performance gate: the following cases have a confidence interval entirely above zero and need investigation before merging: license-spdx, uv-build metadata, strings.

CodSpeed performance gate: marker conflict simplification (imbibe_marker_no_conflicts[0]) measures 343 ns → 398.5 ns (+16.18% time). The report warns that runtime environments differ. The same result was reported after one fixed repeat. The runtime-environment mismatch warning remains; this discrepancy is unresolved and the no-regression requirement is not cleared.

Deserialize the string and table forms of project.readme and project.license directly. A small shared scalar visitor retains malformed/duplicate-field fallthrough without allocating Serde's generic buffered content tree.

README file tables take precedence over text tables; license text tables take precedence over file tables. Required content type, optional charset, and accepted representations remain unchanged. Underlying deserializer errors propagate; malformed-schema errors can be more specific.

Size

Linux x86_64, Rust 1.99.0 / LLVM 23, baseline 4053abea35379683d0336161cad9afddd64190ad, head 43ee3c4876c96be7788ce04710d346918f0cfb7f. Both use the same checkout path, production dependency versions, compiler and build flags. Sizes are GNU-stripped executables; KB = 1,000 bytes.

Binary Before (bytes) After (bytes) Saved (KB) Saved (%)
uv 43,112,480 43,111,552 +0.928 +0.0022%
uvx 318,392 318,392 +0.000 +0.0000%
uv-build 2,954,488 2,949,592 +4.896 +0.1657%

uv and uvx: release profile, self-update enabled, fat LTO, one codegen unit, panic=abort, no PGO. uv-build: the repository’s minimal-size profile with LLD identical-code folding. Registry source paths are remapped identically in both builds.

Performance

Case Before (mean) After (mean) Time change Paired 95% CI
readme-string 0.527 µs 0.526 µs -0.16% [-0.71%, +0.43%]
readme-file 1.927 µs 1.765 µs -8.40% [-9.05%, -7.84%]
readme-text 1.694 µs 1.458 µs -13.89% [-14.23%, -13.54%]
license-spdx 0.512 µs 0.525 µs +2.59% [+2.24%, +2.95%]
license-text 0.968 µs 0.854 µs -11.83% [-12.22%, -11.48%]
license-file 1.053 µs 0.856 µs -18.73% [-19.25%, -18.27%]
uv-build metadata, strings 1.628 ms 1.639 ms +0.67% [+0.08%, +1.28%]
uv-build metadata, tables 1.630 ms 1.631 ms +0.06% [-0.56%, +0.69%]
uv-build wheel, 300 modules 11.336 ms 11.312 ms -0.21% [-0.62%, +0.17%]

Negative time changes are faster. Measurements run on an Intel Xeon Platinum 8573C and use randomized, balanced before/after pairs on one pinned CPU, eight warmups per binary and case, 240 pairs for focused parsing and 600 pairs for complete commands. Focused batches target 25 ms; confidence intervals use 4,000 paired bootstrap resamples. Compilation is stopped during measurement. These are local Linux measurements, not a claim about every workload or platform.

Focused cases use the exact private production Readme/License definitions extracted into a standalone TOML harness, compiled with the minimal-size profile. Command cases use the actual release uv-build: metadata generation for string/table metadata and wheel creation for a 300-module fixture.

Test Plan

  • cargo test --locked -p uv-build-backend --lib: 77 passing tests.

  • cargo clippy --locked --all-targets --all-features -p uv-build-backend -- -D warnings: passed.

  • cargo fmt --all --check and git diff --check: passed.

  • Temporary differential harness: 8,284 fixtures compared with the derived untagged implementation; accepted values and resulting variants matched. The reference implementation and generated corpus are not included in the patch.

  • Focused regression tests cover required fields, precedence/fallthrough, duplicate fields or invalid representations as applicable.

  • Metadata files for strings are byte-identical.

  • Metadata files for tables are byte-identical.

  • 300-module wheels are byte-identical: SHA256 75a283a017b1c736f3e379ea75b30b2af29e352968bfa204815f6ad02be84ec7.

  • uvx executable is byte-identical to baseline.

GitHub benchmark checks are requested with test:benchmarks.

CI status

  • Python lint is blocked by ty 0.0.87: invalid-mutable-override in unchanged scripts/codspeed-profiles.py:166. The same failure reproduces on baseline 4053abea35379683d0336161cad9afddd64190ad; ty 0.0.86 passes on that file.

  • CodSpeed reports imbibe_marker_no_conflicts[0] at 343 ns before and 398.5 ns after (+16.18% time), with a warning that runtime environments differ. This marker-conflict benchmark is outside the changed metadata deserializers; the discrepancy remains unresolved.

  • The fixed simulation repeat completed; CodSpeed updated its report at 2026-10-21 00:36 UTC with the same 343 ns → 398.5 ns result and runtime-environment warning. Both baseline and head use Rust 1.99.0.

@ww-oai ww-oai added the test:benchmarks Enable simulated and walltime benchmarks for a pull request label Oct 20, 2026 — with ChatGPT Codex Connector
@ww-oai
ww-oai force-pushed the codex/deserialize-build-metadata branch from 93866c3 to 9e8edac Compare October 20, 2026 22:25
@astral-automations-bot astral-automations-bot Bot added internal A refactor or improvement that is not user-facing performance labels Oct 20, 2026
@ww-oai
ww-oai deployed to automations October 20, 2026 22:31 — with GitHub Actions Active
@ww-oai
ww-oai deployed to automations October 20, 2026 22:35 — with GitHub Actions Active
Comment thread crates/uv-build-backend/src/metadata.rs Resolved
@ww-oai
ww-oai deployed to automations October 20, 2026 22:39 — with GitHub Actions Active
@codspeed

codspeed Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 13.94%

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 118 untouched benchmarks
⏩ 35 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation imbibe_marker_no_conflicts[0] 343 ns 398.5 ns -13.94%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/deserialize-build-metadata (43ee3c4) with main (5477928)

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch was successfully deployed

1 active deployment
automations — 43ee3c48 Deployed Oct 20, 2026 by ww-oai via review-code-quality / code quality review #11205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing performance test:benchmarks Enable simulated and walltime benchmarks for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant