Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
68c97a5
add constant folding for `applymap` op
tim-hoffman Jul 30, 2026
5291572
changelog
tim-hoffman Jul 30, 2026
f932193
handle heterogeneous arrays in flattening pass
tim-hoffman Jul 30, 2026
e4dfcc5
changelog
tim-hoffman Jul 30, 2026
1d17f85
fix: Preserve table offsets on split member reads
tim-hoffman Jul 30, 2026
19e1af8
fix: Preserve source attributes on replacement member writes
tim-hoffman Jul 30, 2026
21226c2
fix: Refresh dependent candidates after replacing array reads
tim-hoffman Jul 30, 2026
cb1c312
handle heterogeneous arrays in flattening pass
tim-hoffman Jul 30, 2026
f23fc2a
changelog
tim-hoffman Jul 30, 2026
a299cab
fix: Preserve table offsets on split member reads
tim-hoffman Jul 30, 2026
3324cdc
fix: Preserve source attributes on replacement member writes
tim-hoffman Jul 30, 2026
ff91cdd
fix: Refresh dependent candidates after replacing array reads
tim-hoffman Jul 30, 2026
bd54be7
Merge branch 'th/296' of github.com:project-llzk/llzk-lib into th/296
tim-hoffman Jul 31, 2026
2dba2bf
fix: Reject members with writers that cannot be split
tim-hoffman Jul 31, 2026
bf4ba11
handle cases of unwritten values
tim-hoffman Jul 31, 2026
54cc999
fix: Seed scalar values from inline array initializers
tim-hoffman Jul 31, 2026
70fab49
fix: Keep scalar member reads at the original read point
tim-hoffman Jul 31, 2026
50b341e
fix: Allow expandable arrays to populate multiple split members
tim-hoffman Jul 31, 2026
44d8aaf
fix: Preserve metadata on replacement member reads
tim-hoffman Jul 31, 2026
935e0a9
fix: Copy discardable attributes to split member definitions
tim-hoffman Jul 31, 2026
4cf0db7
fix: Materialize index-specific values for shared initializers
tim-hoffman Jul 31, 2026
993dab2
fix: Validate every candidate against the reused split layout
tim-hoffman Jul 31, 2026
76817f4
fix: Track shared values across all split-member writes
tim-hoffman Jul 31, 2026
5958932
fix: Compare all candidate element types for incompatibility
tim-hoffman Jul 31, 2026
581db83
fix: Reject candidate arrays with mismatched static shapes
tim-hoffman Jul 31, 2026
0dd9709
cleanup
tim-hoffman Jul 31, 2026
a693b1b
fix: Check shared values in candidate member writes
tim-hoffman Jul 31, 2026
91beb0e
fix: Validate expandable writers against the split shape
tim-hoffman Jul 31, 2026
e94737c
fix: Include inline initializers when selecting candidates
tim-hoffman Aug 1, 2026
9b5afa9
fix: Avoid ordering users from different blocks
tim-hoffman Aug 1, 2026
a480e21
fix: Refresh cached inline initializer operands
tim-hoffman Aug 3, 2026
96c7342
fix: Validate scalar read types before replacing uses
tim-hoffman Aug 3, 2026
885c274
fix: Reject cross-block users before sorting
tim-hoffman Aug 3, 2026
5a2e3f7
fix: Account for external uses of scalarized element values
tim-hoffman Aug 3, 2026
a3d995a
fix: Validate expandable reads against split member types
tim-hoffman Aug 3, 2026
10a61fe
fix: Preserve shared nondeterministic values across member writes
tim-hoffman Aug 3, 2026
65848e2
fix: Retain the most concrete type across candidate writers
tim-hoffman Aug 3, 2026
3e0968e
fix: Validate stored values against each split-member type
tim-hoffman Aug 3, 2026
fb7d688
fix: Validate public member reads outside the defining struct
tim-hoffman Aug 3, 2026
d036317
fix: Merge complementary candidate type refinements
tim-hoffman Aug 3, 2026
6d60e7c
fix: Reuse one witness when refining an unwritten element
tim-hoffman Aug 3, 2026
c4d9640
fix: Revalidate candidate layouts after refreshing dependencies
tim-hoffman Aug 3, 2026
92a682b
fix: Allow initialized fallbacks to be stored across branches
tim-hoffman Aug 3, 2026
defa8bc
fix some small issues and cleanup
tim-hoffman Aug 3, 2026
07cf95b
fix: Reuse one witness across compatible refinements
tim-hoffman Aug 3, 2026
02c492c
fix: Scope the instantiation cache by parent module
tim-hoffman Aug 3, 2026
f8eb4a9
fix: Rebuild cached callee paths for each call site
tim-hoffman Aug 4, 2026
cf84e6b
fix: Validate reads of already-valued expandable indices
tim-hoffman Aug 4, 2026
fff21a7
fix: Preserve the instantiation cache across fixpoint iterations
tim-hoffman Aug 4, 2026
37a1a7d
fixup
tim-hoffman Aug 4, 2026
30ea4cd
Merge branch 'main' into th/296
tim-hoffman Aug 4, 2026
e12135a
Merge branch 'main' into th/296
tim-hoffman Aug 4, 2026
e0f68a9
standardize expected error checks
tim-hoffman Aug 4, 2026
fb8509d
fix: Materialize the specialized value before replacing local reads
tim-hoffman Aug 4, 2026
587ca28
formatting
tim-hoffman Aug 5, 2026
3076e49
update error notes
tim-hoffman Aug 6, 2026
56df0e9
Merge branch 'main' into th/296
tim-hoffman Aug 6, 2026
56b3f49
Merge branch 'main' into th/296
tim-hoffman Aug 10, 2026
360676e
handle a mismatched shape case
tim-hoffman Aug 10, 2026
ca314ac
add missing filecheck
tim-hoffman Aug 10, 2026
1b75da5
fix a flattening type conflict
tim-hoffman Aug 10, 2026
389a535
fix: Reuse one specialized witness for repeated reads
tim-hoffman Aug 10, 2026
c3e68fe
fix: Preserve attributes on typed nondet replacements
tim-hoffman Aug 10, 2026
c0ec401
fix: Preserve one witness across differently typed indices
tim-hoffman Aug 10, 2026
ff6cd93
fix: hoist cached read witnesses before branch uses
tim-hoffman Aug 10, 2026
445b66b
fix: Share specialized witnesses with scalar member writes
tim-hoffman Aug 10, 2026
765ea22
fix: Copy attributes to expandable-array witness refinements
tim-hoffman Aug 10, 2026
b96a134
fix: Keep specialized reads tied to the source witness
tim-hoffman Aug 10, 2026
61bcd0b
fix: Copy source attributes onto read-specialized witnesses
tim-hoffman Aug 10, 2026
ab3fe75
fix: Keep earlier expandable reads on the refined witness
tim-hoffman Aug 10, 2026
1feee30
fix: Revalidate local reads after dependency refresh
tim-hoffman Aug 10, 2026
f66ee54
fix: Check member reads before merging write refinements
tim-hoffman Aug 10, 2026
6f3470c
fix: Preflight unsupported shared-witness uses
tim-hoffman Aug 10, 2026
4b7c486
fix: Include split-member refinements in shared witness planning
tim-hoffman Aug 10, 2026
b1bcebe
small code cleanup
tim-hoffman Aug 10, 2026
cd31801
fix: Specialize witnesses required only by split writes
tim-hoffman Aug 11, 2026
35a5f78
fix: Key full instantiations by exact bindings
tim-hoffman Aug 11, 2026
9fdc7cc
fix: Preserve unresolved template expressions in partial clones
tim-hoffman Aug 11, 2026
7fff098
fix: Reject shared ordinary values with different split types
tim-hoffman Aug 11, 2026
424e77a
fix: Place specialized witnesses before earlier external constraints
tim-hoffman Aug 11, 2026
2fe55d2
fix: Preserve attributes on retargeted constraint calls
tim-hoffman Aug 11, 2026
afa244d
fix: Validate consumers before concretizing array reads
tim-hoffman Aug 11, 2026
cabd53c
fix: Preserve attributes on Step 1 nondet replacements
tim-hoffman Aug 11, 2026
788e9cf
fix: Validate the first ordinary value refinement
tim-hoffman Aug 11, 2026
a5e2a8f
add new regression test to replace the co-opted one
tim-hoffman Aug 11, 2026
07810a2
allow for non-determinism in test
tim-hoffman Aug 11, 2026
b391f47
fix: Scope wildcard inference bindings to their template
tim-hoffman Aug 11, 2026
cf689b4
Merge branch 'main' into th/296
tim-hoffman Aug 11, 2026
9b50b81
fix: Validate non-member consumers before replacing reads
tim-hoffman Aug 11, 2026
e4ff441
fix: Check the full constraint signature before retargeting
tim-hoffman Aug 11, 2026
e9fe536
Merge branch 'main' into th/296
tim-hoffman Aug 11, 2026
7143c8e
fix: Validate consumers of refined member reads
tim-hoffman Aug 11, 2026
9f048a2
fix: Preserve attributes from scalarized array reads
tim-hoffman Aug 11, 2026
64a4be5
fix CI build error
tim-hoffman Aug 11, 2026
3a469c6
fix: Accept unifying arguments when retargeting constraints
tim-hoffman Aug 11, 2026
8d350c0
fix: Copy expressions referenced only by function types
tim-hoffman Aug 11, 2026
b62d636
group flattening pass tests into fewer files
tim-hoffman Aug 11, 2026
7dc72b9
fix: Validate every typed consumer before replacing array reads
tim-hoffman Aug 12, 2026
63341ac
expand on regression test comment
tim-hoffman Aug 12, 2026
eca337f
Merge branch 'main' into th/296
tim-hoffman Aug 12, 2026
5483b9f
fix: Reject candidate writes with different index sets
tim-hoffman Aug 12, 2026
2f72015
fix: Validate array initializers before replacing reads
tim-hoffman Aug 12, 2026
14b50be
fix: Keep reads with conflicting provenance separate
tim-hoffman Aug 12, 2026
b046172
fix: Preflight split-read consumers before mutating candidates
tim-hoffman Aug 12, 2026
a341d08
fix: Preserve external observations when refining direct writes
tim-hoffman Aug 12, 2026
eb70755
fix: Guard array initializers before refining member reads
tim-hoffman Aug 12, 2026
c0414c2
add test for: Materialize shared unifiable casts before split writes
tim-hoffman Aug 12, 2026
dfe3d1a
fix: Preflight local read consumers before rewriting candidates
tim-hoffman Aug 12, 2026
b42cb2b
clang-tidy
tim-hoffman Aug 12, 2026
4a28b9b
fix: Validate every member target before retagging casts
tim-hoffman Aug 12, 2026
3d6c216
fix: Preserve per-element write attributes on scalar writes
tim-hoffman Aug 12, 2026
bf67a58
combine duplicate code
tim-hoffman Aug 12, 2026
29df055
fix: Preserve sibling callees in partial templates
tim-hoffman Aug 12, 2026
755ef86
add test: Validate return consumers before refining member reads
tim-hoffman Aug 12, 2026
795b5bc
fix: Validate unifiable-cast consumers before replacing reads
tim-hoffman Aug 13, 2026
228d575
fix: Check array writes before refining member reads
tim-hoffman Aug 13, 2026
31655b6
Merge branch 'main' into th/296
tim-hoffman Aug 13, 2026
c1c4169
fix: Compute shared read refinements before replacing users
tim-hoffman Aug 13, 2026
000ce43
fix: Validate array users before refining initializer-driven types
tim-hoffman Aug 13, 2026
cefdb3b
fix: Preserve attributes when converting wildcard array reads
tim-hoffman Aug 13, 2026
123bafa
fix: Preflight expandable read consumers before rewriting
tim-hoffman Aug 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/unreleased/th__296.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixed:
- "Fix issue #296 so flattening pass creates multiple instantiated structs for heterogeneous arrays of structs."
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,22 @@ def FlatteningPass : LLZKPass<"llzk-flatten"> {
let summary = "Flatten structs and unroll loops";
let description = [{
Performs the following transformations:
- Instantiate `affine_map` parameters of StructType and ArrayType
to constant values using the arguments at the instantiation site
- Replace parameterized structs with flattened (i.e., no parameter)
versions of those structs based on requested return type at calls
to `compute()` functions and unroll loops
- Unroll loops
- Instantiate the main struct, when one is specified.
- Instantiate parameterized structs and free functions when concrete
template arguments are available at use sites.
- Replace instantiated `poly.const_read` uses, symbolic member table
offsets, wildcard array reads/writes, and callees rooted at concrete
template parameters inside cloned bodies.
- Unroll loops with statically-known trip counts.
- Fold `affine_map` parameters of StructType and ArrayType to constant
values using the operands at the instantiation site.
- Scalarize pseudo-homogeneous arrays whose static elements refine to
different concrete types after instantiation.
- Propagate refined types through arrays, members, calls, returns, inferred
result types, and unifiable casts until a fixpoint is reached.
- Clean up unused parameterized definitions according to the selected
cleanup mode, remove empty templates, and remove unused discardable
array allocations.
}];
// Implementation note: These options should be kept in sync with
// `StructInliningFlatteningOptions` in `LLZKTransformationPassPipelines.h`.
Expand Down
Loading