Repository navigation
Conversation
… the whole body The direct-callee prototype is inferred twice: from the complete decode, then from a decode capped at the stable-prefix instruction limit, whose pointer evidence fills slots the complete preview left empty. A callee shorter than that limit decodes to the same p-code both times, and the preview is a function of the p-code alone -- the evidence kind only labels diagnostics -- so the second run reproduces the first and the merge keeps nothing from it. Each run is a raw-HIR build plus a full normalize. On the full DecBench dataset 14-59% of prefix previews were such repeats (ssh-sk-helper 83/486, ssh 167/1163, cf2 667/1135). Profiling the eight slowest subset binaries put callee previews at ~40% of decompile CPU. Subset (81 binaries, 7,969 functions), on top of #883: wall 133.8 -> 127.5 s (-4.7%), CPU 721 -> 675 s; code identical for all 7,969 functions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e same time Decompile workers start together and share popular callees, and the summary cache is filled only after the computation, so workers that miss the same key concurrently each ran it: 16% of ssh-sk-helper's and 11% of ssh's summary misses on the full DecBench dataset were a key another worker was already computing. Misses now go through a per-key OnceLock: the first worker computes, the others wait for its result, and the result enters the LRU before it leaves the in-flight map. Only threads outside the rayon pool wait. A rayon worker blocked on the cell could be the one the computing thread's own rayon work needs (the OnceLock-blocks-on-rayon deadlock seen before), so a rayon worker computes the summary itself as it did before. Previews do not recurse into other callees, so a computation never waits on its own key. Subset (81 binaries, 7,969 functions): wall 125.7 -> 123.0 s, CPU 669 -> 626 s (-6.4%); code identical for all 7,969 functions; no hang. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…alifies drop_unused_call_receivers folds liveness bottom-up at every nesting level (LivenessTransfer per statement, plus a live-out per nested list), and it runs inside the type fixed point of every function and every callee preview -- 6% of decompile samples on the slowest subset binaries. It only ever rewrites an unprotected receiver of a known API call outside loops, so when the body has no such assignment its result is already 0. Check that first. Subset (81 binaries, 7,969 functions): wall 123.1 -> 116.6 s, CPU 629 -> 614 s; code identical for all 7,969 functions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ere it began The type fixed point runs type_inference, callsite_type_prop, use_driven_type_infer and type_constraint_prop per round and stops when none reports a change, capped at six rounds. The passes undo one another inside a round -- one widens a binding, a later one narrows it back -- so each reports a change while the round ends exactly where it started. On two full-dataset binaries 24,270 of 27,033 rounds (90%) did, and almost every fixed point ran to its cap. The passes read nothing but the function, so a round that returns to its starting state would repeat itself identically until the cap and leave the same state. Compare the function before and after the round (it derives Eq) and stop when they match. Subset (81 binaries, 7,969 functions): wall 115.5 -> 97.1 s (-16%), CPU 613 -> 507 s; code identical for all 7,969 functions. Which pass pair undoes the other is left open; it is a convergence defect in its own right, but fixing it changes output and needs measuring. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
tabulate_over evaluated the guard once per row, and at every atom leaf looked the atom up in the atom list by structural PreHirExpr equality -- up to 4,096 rows times every leaf, each a deep comparison. Resolve each atom to its column once, then evaluate 64 rows per u64 with AND/OR/NOT over fixed column masks (in-word patterns for atoms 0-5, whole words selected by the word index above that). Same table, bit for bit. The row-at-a-time evaluator stays in the tests as an oracle; a generated set of 400 formulas over 1-12 atoms must agree with it on every row, and the test fails if either the in-word or the cross-word column pattern is broken. Subset (81 binaries, 7,969 functions): wall 93.8 -> 92.6 s, CPU 498 -> 483 s; code identical for all 7,969 functions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Found by attributing library self time (memmove, malloc, hashing) to the nearest Fission frame in a profile of the eight slowest subset binaries. - fuse_single_predecessor_boundaries deep-copied the run up to the next label for every statement of a list, then looked at the statement. Only an `if` with a lone `goto` arm whose target is that next label can be rewritten; decide that first and move the run instead of copying it. A 4,000-case generated test holds the rewrite to the implementation it replaced (kept as the test's oracle) and fails if the two disagree. - best_prior_definition_for_missing_pred ran a forward BFS per candidate block to the same predecessor. One backward BFS over the reversed successor edges gives every candidate's distance. - lookup_candidate_def_keys walked every defined key per lookup. The definition table and the register model do not change after the builder is created, so the answer is kept per key. The last two carry debug assertions against the computation they replace; a release build with debug assertions ran 3,048 functions of five full-dataset binaries without one firing. Subset (81 binaries, 7,969 functions): wall 97.7 -> 89.4 s, CPU 480 -> 451 s (-6.0%); code identical for all 7,969 functions. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ved register maps Binary-level data was rebuilt for every function render and every callee preview. - seed_nir_render_options builds `global_names` from the binary's symbol, import, function and string tables -- thousands of entries, each a sanitized copy. The seeded options are now kept per inner-data snapshot and copied out. The key is a `Weak` to the binary's copy-on-write inner data (`LoadedBinary::inner_snapshot`): while it exists the allocation can be neither freed nor mutated in place, so pointer identity means "same contents". Options seeding reads nothing outside the inner data except `SelectionAxis::from_env`, which is still read per call. Tests cover an unchanged binary, a change made while another handle shares the data, and one made in place; the last two fail with the snapshot check off. - RegisterNamer::from_options copied the options' register map and grouped it by offset on each of the several namer builds per function. The two derived maps are reused by content of the source map; a test checks that a different map gets its own, and fails if only the size is compared. Subset (81 binaries, 7,969 functions): CPU 450.9 -> 442.6 s (-1.8%), wall 85.0 -> 84.7 s; code identical for all 7,969 functions. Co-Authored-By: Claude Fable 5.2 <[email protected]>
build_out_of_ssa_facts asked value_crosses_guard for every (member, guard) pair, and each call walked the dominator chain from the guard's block: the largest single self-time entry of a decompile, and one that three earlier attempts (hoisting the guard list, bitmap reachability) did not move, because they kept the per-pair loop. Guards of one block share everything but their position, so for a value and a block the crossed guards are a contiguous run of that block's guards: the definition reaches every guard of a block it strictly dominates and the guards after it in its own block; a use lies after all of a block's guards when its block is reachable from the guard block, and otherwise after the guards preceding the last use inside the block. The guard blocks a block strictly dominates are collected once from the idom chains, each run is found by binary search, and the per-variable result is read off a reused mark array in guard order. value_crosses_guard stays as the debug assertion's oracle. It held on 3,075 functions of six full-dataset binaries in a release build with debug assertions, and fires in the unit tests when the same-block bound is off by one or only the immediate dominator is recorded. Subset (81 binaries, 7,969 functions): wall 85.0 -> 80.7 s, CPU 448 -> 431 s (-3.9%); code identical for all 7,969 functions. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four output-preserving speed changes, measured on the full DecBench dataset (
noelo-lab/decbench-dataset, configfull), stripped binaries, all listed functions per binary in onedecomp --addresses-filecall, fixed every-10th subset of 81 binaries / 7,969 functions. Every step was checked for identicalcodeon all 7,969 functions.Cumulative, main after #883 vs this branch in one interleaved run: wall 128.9 -> 79.3 s (-38%), CPU 695 -> 425 s (-39%), code identical for all 7,969 functions (O0 45 -> 24 s, O2-noinline 43 -> 28 s, O2 41 -> 27 s).
How they were found
OnceLock; rayon workers compute themselves, avoiding the OnceLock/rayon deadlock seen before.elapsed_msfrom the debug log putcallsite_type_prop(39%) anduse_driven_type_infer(27%) on top of normalize. Inside the first,drop_unused_call_receiversfolds liveness at every nesting level even when no receiver can be dropped.PreHirFunction: Eq), so such a round would repeat identically; the loop now stops there.Later commits
fuse_single_predecessor_boundariesdeep-copied the run up to the next label for every statement; it now decides first and moves the run. A 4,000-case generated test holds it to the old implementation.Weakto the binary's copy-on-write inner data (LoadedBinary::inner_snapshot): while theWeaklives the allocation can be neither freed nor mutated in place, so pointer identity means same contents. Tests cover shared and in-place mutation and fail with the check off.value_crosses_guardstays as the debug-assertion oracle; it held on 3,075 real functions and fires when the new code is broken two different ways.Tried and dropped
An op read/write index for
collect_output_use_sites_outside_block(2.6% self time) measured -0.8%, inside run-to-run noise once the per-builder index build is paid; not kept.Not done here
Which pass pair undoes the other inside a type round is a convergence defect of its own; fixing it changes output and needs a GED measurement.
Tests
No behaviour change;
fission-midend-normalize+fission-pcodegreen under the test profile and--release,fission-decompilergreen, CI clippy line clean, fmt clean.🤖 Generated with Claude Code