Repository navigation
Conversation
…lity CI - structured.rs: region-based structuring over the final CFG. Natural loops from dominator back edges, post-dominator merges on region views (return blocks with one predecessor are early exits), while/for/generic-for with break/continue, dispatch flags for multi-exit loops. Falls back to the legacy GraphStructurer on any unproven shape, budget overrun or deadline. - lift() tries the structured path first; output is validated for no goto/labels/leftover for-loop IR. - decompiler-quality.yaml: compares this branch against main on a corpus (goto count, -- block count, incomplete markers, recompile check). - scripts/decompile_corpus.sh and decompiler-corpus/ (8 Luau sources). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
- StableGraph::node_bound is a NodeIndexable trait method, not inherent; compute the index bound directly. This was the compile error breaking cargo check (Android) and the restructure unit tests. - emit_loop now marks the header emitted for while/for forms; emit() requires every reachable node to be emitted, so without this every while/for loop fell back to the legacy structurer. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Run all test binaries with --no-fail-fast, keep the full output, and emit error annotations for panics, compile errors and failed tests so the cause can be read through the API without the raw job log. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
- Corpus runs before unit tests so a test failure cannot hide the output. - ast/cfg/restructure unit tests run for both new and baseline as informational (continue-on-error) so pre-existing failures are visible as a comparison; restructure tests stay a hard gate on new. - SUMMARY.md rows and topaz log hits are published as notice annotations. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The corpus shows goto counts unchanged from main, so the structurer is falling back to the legacy path. Each bail-out now records its reason when TOPAZ_STRUCTURED_DEBUG is set, and the corpus job publishes the aggregated reasons as annotations. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…(debug) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ivalence - for/while forms looked at every exit, so a 'return' inside a loop (copied inline by classify) rejected the loop. Only real exits count now. - Build the luau REPL alongside luau-compile and compare original vs decompiled stdout and exit code per corpus file (same output column). - Corpus 07 is self-contained and deterministic (no math.random, has a driver that prints). Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ormalize error line numbers Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… enclosing functions Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…e live vs commented gotos, list fallbacks Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…atch by flag after the loop; log every fallback Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…udget note lists the most emitted nodes Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…t shared node (no tail copies); nested arms keep the enclosing stop Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…t-dominator; richer for-shape note Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…tch the other exit by flag Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…GUI/Android routes and samples Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ocal limit Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…then nested locals, when above 150 Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… with no merge (debug output only) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ate-emit experiment) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ation); spill the minimal set of locals Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…s hit it at line 4836) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ication (node emitted 9856x) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ing stop Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…closure has no effects) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ither is rewritten; the closure's upvalue follows Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ing; spill only what is still over the limit Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ng plan" This reverts commit 0bb0f00.
…re spilling; spill only what is still over the limit" This reverts commit 7d2a8b7.
…for functions over the limit) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…till over the limit Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ak of the large body (see notes); spill stays as before Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…I (constants, opcodes, analyzer errors) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ons without a counterpart Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…th its line and function Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ls after each post pass Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…e stage per function Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…elsewhere, add start step Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…tep in the ClientRenderer workflow Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… per function Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…s of each function Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…pped counts Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ropped declarations, read-never-written locals) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…t crowded out Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ents Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… record the statements that contain one Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ns keep them Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…debug), count placements with no block Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
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.
Summary
restructure/src/structured.rs: goto-free, region-based structurer. Emitsif,while,for, genericfor, withbreak/continue. Loops with several real exits use a flag and dispatch after the loop (for bothwhileandforforms).join_all), so tails are not copied into each arm. Loop exits use the same join when there is no post-dominator.lift()tries the structurer first and falls back to the legacyGraphStructurerwhen a shape is not proven. Every fallback is logged with its source line whenTOPAZ_STRUCTURED_DEBUG=1..github/workflows/decompiler-quality.yaml: corpus check, new vs main..github/workflows/clientrenderer.yaml: bounded decompile ofClientRenderer_LocalScript_88615311464962_Bytecode.txt(timeout -s KILL 900,--time-budget 600), with a PASS/FAIL verdict. The branch run fails on FAIL. The baseline run never fails.Verified in CI (commit f95a203)
decompiler-quality): same files pass and fail as before.goto0 and-- block0 everywhere.0153→67 lines and0545→54 lines because of flag dispatch; both still produce the same output.restructureunit tests (gate): pass.clientrenderer, branch run):TOPAZ_INCOMPLETEafter ~5s (not a timeout).-- block5, commented-out gotos/labels 104. All 104 come from one function (the 422-loop function at line 4836).luau-compilefails withcFrame652: exceeded limit 200(Luau's 200-local register limit). This is the known open item in CODEBASE.md, and the structurer does not change it.206612 > 206600). Nodes 7540–7562 are each emitted 29 times, so there is still tail duplication there.Not solved yet
-- blockand commented-out gotos come from.localtemporaries from SSA copies, and genericforloops print internal result locals.main, unrelated to this branch:03losesstatenaming,07renamesself(runtime error).cfgdestructandastinline_gotosunit tests fail onmainas well.