Files
reverse-engineering-anything/docs/guides/native
morluto eb47944003 perf(decompile-all): group durable writes per batch of functions (#14858)
* perf(decompile-all): group durable writes per batch of functions

The export synced each function file and then the journal, one function at a time, so it spent about as long waiting on the disk as decompiling.

Each file's bytes are now synced in staging while later functions are decompiled. A group of up to eight functions then publishes its files in visit order and appends its journal records with one write and one sync. A journal record is still written only after its file's content is synced and published. Cancellation and failures commit the pending group before they are reported.

Files, journal records and their order, the index and counts are unchanged. A stopped process or host now leaves up to eight decompiled functions unrecorded instead of one; a resume decompiles them again and adopts files already in place.

Addresses #14830

* fix(decompile-all): commit the pending group on a throw and after one second

A provider adapter that threw inside a group dropped the functions already
decompiled in it: their staged files were removed and no record was written,
where each had been committed before the next was requested. The pending group
is now committed before the throw propagates.

A group is also committed by the first function that settles a second or more
after the previous commit, so a slow provider is committed function by function
instead of leaving up to eight long decompilations unrecorded.

Adds the missing lifecycle regressions: a caller abort during a group's
publication and during its journal append, a failed removal of a discarded
staged file, and a resume beside staging left by a stopped run.

* test(decompile-all): release the export a failed-discard test retains

The test left its export's cleanup failing, so the directory lease stayed held
by the test process. The lease is keyed by device and inode; where the
filesystem reuses the removed directory's inode, the next test's export was
refused as already running. The test now gives the export a resource scope,
retries the retained cleanup once removal works, and resumes in the same
directory, which also covers the cleanup retry.

* fix(decompile-all): retain failures the group commit observed after a stop or throw

A write failure that stops a group now keeps a later function's provider failure as a secondary failure, with its cleanup still attached. When a provider throws and the commit of earlier functions then fails, that commit failure is returned as primary and the throw is retained with it. The first provider failure before an independent retry now joins the group before the retry runs, so a retry that throws cannot drop it.

* refactor(decompile-all): compose every export failure through one owner

Group settlement now carries each entry's outcome: the first stop leads, entries after it are abandoned but keep any failure they observed, and a failed journal append leads those. One composeFailures helper retains later failures as secondary and keeps every cleanup they own, and the final publish/index/close composition uses it too, so an index failure that still owns cleanup is no longer dropped behind an earlier failure. A journal write failure also keeps a later invalid record as a secondary failure.
2026-11-27 04:36:05 -05:00
..