Skip to content

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Oct 28, 2024

No description provided.

@fglock fglock merged commit 531e13c into master Oct 28, 2024
fglock added a commit that referenced this pull request Oct 1, 2025
Added comprehensive summary of all fixes completed so far:
- Fix #1: @_ empty in eval blocks (+306 tests)
- Fix #2: Z format null termination (+7 tests)
- Fix #3: ByteBuffer endianness bug (in progress)

Total improvement: +313 tests (8,937 → 9,250, +3.5%)

Documented root causes, verification tests, and next high-impact fixes.
fglock added a commit that referenced this pull request Oct 18, 2025
DEEP DIVE FIX #2: Added support for .N where N specifies group nesting level.

The Problem:
- Dot format .N should return position relative to Nth group level up
- .0 = 0 (self), .1 = innermost group, .2 = parent group, .* = absolute
- Original code only handled .1 (innermost) and .* (absolute)
- Tests like unpack("x3(X2.2)", $data) failed (expected 1, got -2)

The Solution:
1. Added comprehensive Javadoc explaining .N semantics with examples
2. Added UnpackState.getGroupDepth() - returns current nesting level
3. Added UnpackState.getRelativePosition(int level) - gets position relative to Nth level
4. Fixed DotFormatHandler logic:
   - count > depth: return absolute position (outer context)
   - 1 <= count <= depth: return position relative to that level
   - Used TRACE to debug: found count=2, depth=1 case was wrong

The Fix Uses Stack Indexing:
- Stack grows as groups nest: [outer_base, inner_base, ...]
- Level 1 = top of stack (innermost)
- Level 2 = one below top (parent)
- Convert Deque to array for indexed access

Tests Fixed: 14642, 14644, 14648, 14650, 14654, 14656 (+6)
Total: 137 failures (was 143)
Pass rate: 99.03% -> 99.07% (14,587/14,724)

Session total: 11 tests fixed (148 → 137)
fglock added a commit that referenced this pull request Jan 5, 2026
This test is for control flow features, not pack/unpack fixes.
Test #2 is failing in current master, so removing from this PR.
fglock added a commit that referenced this pull request Jan 6, 2026
Add registry check after each statement in simple labeled blocks (≤3 statements)
to handle non-local control flow like 'last SKIP' through function calls.

The check:
- Only applies to labeled blocks without loop constructs
- Checks RuntimeControlFlowRegistry after each statement
- Jumps to nextLabel if matching control flow detected
- Limited to simple blocks to avoid ASM VerifyError

Results:
- make: BUILD SUCCESSFUL
- Baseline maintained: 66683/66880 tests passing in perl5_t/t/uni/variables.t
- skip_control_flow.t: tests #1 and #3 pass, test #2 still needs investigation
fglock added a commit that referenced this pull request Jan 6, 2026
Added registry check in EmitBlock.java for labeled blocks.
Renamed test to use MYLABEL instead of SKIP to prove it's not special.

Current status:
- skip_control_flow.t: test #2 still fails (needs investigation)
- Baseline tests pass when run with jperl directly
- Test runner shows issues but direct execution works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants