Skip to content

Move finalized dependency edges into output - #542

Merged
tinder-maxwellelliott merged 1 commit into
Tinder:masterfrom
tamird:tamird/move-dependency-edges
Oct 23, 2026
Merged

tinder-maxwellelliott merged 1 commit into
Tinder:masterfrom
tamird:tamird/move-dependency-edges

Conversation

@tamird

@tamird tamird commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

With dependency tracking enabled, finalized dependency vectors were stored in TargetHash and cloned into HashFileData.dep_edges. Building that map also walked every hash entry a second time.

Return each finalized vector with its label hash and move it into dep_edges during aggregation. Instance ordering and dependency deduplication stay at the existing aggregation boundary. The serialized hash and edge formats remain unchanged; the removed field belongs to the internal Rust API. 1

Codex for Tamir.

@tamird

tamird commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

This PR keeps the two maps. The prototype stored dependencies in each target row and projected the hash and edge JSON outputs from one map. It reduced finalization time and peak RSS with tracking on the measured leaf workload, but increased RSS without tracking and had inconclusive timing there.

The comparison used 1,000,000 unconfigured SourceFile leaves with zero dependency edges, Bazel -c opt builds with a MiMalloc test allocator, and fresh processes in baseline–candidate–candidate–baseline order for each mode on arm64 macOS. The common workload timed finalization, the production buffered hash writer, and tracked edge encoding.

Without tracking, the paired changes in the sum of measured phases were +5.47% and −11.78% relative to this PR, so time was inconclusive. Mean peak RSS increased from 432.0 to 473.4 MiB (+41.3 MiB, +9.57%). TargetHash grew from 104 to 128 bytes in this build; RSS covers the whole test process, including fixture setup and buffers.

With tracking, the sum of finalization, hash serialization plus writing, and edge encoding fell from 637.6 to 422.3 ms on average (−33.76%), lower in both pairs. Mean peak RSS fell from 567.4 to 475.0 MiB (−92.4 MiB, −16.28%). Edge encoding itself did not improve: 22.0 to 23.2 ms on average.

Hash outputs were 157,000,001 bytes and tracked edge outputs were 28,000,001 bytes; sizes and SHA-256 digests matched in every applicable run. This synthetic workload does not establish performance for representative graphs, parsing, or the full workflow.

Codex for Tamir.

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

This PR keeps the two maps. The prototype stored dependencies in each target row and projected the hash and edge JSON outputs from one map. It reduced finalization time and peak RSS with tracking on the measured leaf workload, but increased RSS without tracking and had inconclusive timing there.

The comparison used 1,000,000 unconfigured SourceFile leaves with zero dependency edges, Bazel -c opt builds with a MiMalloc test allocator, and fresh processes in baseline–candidate–candidate–baseline order for each mode on arm64 macOS. The common workload timed finalization, the production buffered hash writer, and tracked edge encoding.

Without tracking, the paired changes in the sum of measured phases were +5.47% and −11.78% relative to this PR, so time was inconclusive. Mean peak RSS increased from 432.0 to 473.4 MiB (+41.3 MiB, +9.57%). TargetHash grew from 104 to 128 bytes in this build; RSS covers the whole test process, including fixture setup and buffers.

With tracking, the sum of finalization, hash serialization plus writing, and edge encoding fell from 637.6 to 422.3 ms on average (−33.76%), lower in both pairs. Mean peak RSS fell from 567.4 to 475.0 MiB (−92.4 MiB, −16.28%). Edge encoding itself did not improve: 22.0 to 23.2 ms on average.

Hash outputs were 157,000,001 bytes and tracked edge outputs were 28,000,001 bytes; sizes and SHA-256 digests matched in every applicable run. This synthetic workload does not establish performance for representative graphs, parsing, or the full workflow.

Codex for Tamir.

Thanks for the metrics, approved

@tamird

tamird commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Green at last

@tamird

tamird commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@tinder-maxwellelliott one failure

FAIL: //src:rust_tests (Exit 101) (see /home/runner/.cache/bazel/_bazel_runner/789be8cce26f55b14079335a5cb85410/execroot/_main/bazel-out/k8-fastbuild/testlogs/src/rust_tests/test.log)

where is that log?

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

@tinder-maxwellelliott one failure

FAIL: //src:rust_tests (Exit 101) (see /home/runner/.cache/bazel/_bazel_runner/789be8cce26f55b14079335a5cb85410/execroot/_main/bazel-out/k8-fastbuild/testlogs/src/rust_tests/test.log)

where is that log?

Adding extraction of those failures here #546

With dependency tracking enabled, finalized dependency vectors were
stored in TargetHash and then cloned into HashFileData.dep_edges.
Building that map required a second walk over every hash entry.

Return each finalized vector alongside its label hash and move it into
dep_edges during aggregation. TargetHash now contains only the kind and
digests. Aggregation keeps its existing instance ordering and dependency
deduplication before moving each vector.

Codex for Tamir.
@tamird
tamird force-pushed the tamird/move-dependency-edges branch from 4cbf118 to 1b27139 Compare October 23, 2026 20:15
@tamird

tamird commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

This is green again!

@tinder-maxwellelliott
tinder-maxwellelliott merged commit 57fdd5c into Tinder:master Oct 23, 2026
21 checks passed
@tamird
tamird deleted the tamird/move-dependency-edges branch October 23, 2026 21:13
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