Conversation
- Fix misleading comment that SInt slice returns Bits — it preserves the source type (SInt→SInt, UInt→UInt, Bits→Bits) (#65) - Add Bit Concatenation section documenting the ++ operator and tuple .toBits alternative (#66) - Clarify that .width works on DFHDL values (ports, variables, constants declared with <>) with cross-reference (#67) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…perations Two changes to the exactOp macros in Exact.scala: 1. Remove cleanTypeHack indirection — the extra transparent inline + inline match layer around every exactOp* call was causing the Scala 3 compiler to re-expand the inline tree exponentially at each chained operation. 2. Add flattenInlined tree optimization — the macros now flatten nested Inlined nodes from subexpressions by extracting val bindings into a flat Block, reducing the tree depth that the compiler's posttyper phase processes. Together these reduce compile time for chained arithmetic expressions from exponential to near-linear (e.g. 4-operand + .bits(13,0): 23s → 3s, 5-operand: 176s → 7s). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the cleanTypeHack inline-match workaround with ascribeWidenedType, which adds a Typed node using the dealiased type in the macro output. This achieves the same clean error messages (no ExactOp2Aux[...].Out projections) without adding an extra transparent inline layer that caused exponential compile time growth. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies that error messages from chained transparent inline operations show resolved DFVal types rather than ExactOp2Aux[...].Out projections. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Check1.Check and Check2.Check inline given instances don't need transparent since they always return Check[...] with no type narrowing. Removing transparent avoids unnecessary inline expansion overhead during given resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Neither CTName nor DualSummonTrapError use dependent type narrowing in their return types, so transparent is unnecessary overhead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds a plugin phase that runs between typer and posttyper to flatten deeply nested Inlined trees from chained transparent inline expansions. The Scala 3 posttyper phase exhibits super-linear behavior on nested Inlined nodes, so flattening them beforehand reduces compile time further for large expression chains. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…and execution separation
Pre-minimize Inlined call trees in FlattenInlinedPhase to prevent PostTyper from re-transforming complex call trees that are immediately discarded. PostTyper's Inlined handler calls transform(call) but replaces the result with inlineCallTrace — a simple Ident. By pre-computing this Ident in our plugin phase, we eliminate O(N²) behavior from chained inline expansions. Results: 8 additions 33s→2s, 9 additions 130s→3s, 20 additions ∞→7s. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
A 20-addition chain (21 operands) that would have been impossible to compile before the FlattenInlinedPhase.minimizeCall fix. If this regresses, compilation of this test file will hang or OOM. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consecutive same-op anonymous Funcs for &, |, ^, and ++ (DFBits only) are now merged into a single multi-arg Func during elaboration. For example, `a ^ b ^ c` produces Func(^, [a, b, c]) instead of nested binary Funcs. +, -, * are excluded because carry promotion assumes binary (2-arg) Funcs. ++ is restricted to flat DFBits concatenation (not struct/vector/string). Multi-referenced nodes are not merged to preserve CSE naming. Merged positions span from the first operand to the last in the chain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 9, 2026
[Knowledge Gap] mandelbrot.sv - Scalar Int * SInt operand order matters
DFiantHDL/dfhdl_by_agents#70
Closed
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.
Fixes #374 and #375