Skip to content

fix: runtime detection#90

Merged
g4titanx merged 3 commits intomasterfrom
fix/runtime_section_detection
Nov 24, 2025
Merged

fix: runtime detection#90
g4titanx merged 3 commits intomasterfrom
fix/runtime_section_detection

Conversation

@EmperorOrokuSaki
Copy link
Member

Replaced the fragile heuristic-based runtime section detection with a simple and deterministic approach. The old code tried to guess where runtime bytecode starts by pattern-matching on CODECOPY+RETURN sequences, which failed unpredictably across different compiler versions and optimization levels. It required multiple fallback passes and would literally estimate values when it couldn't find them.

The new implementation takes the actual runtime bytecode as an optional parameter and does a direct substring search using a sliding window. When you provide both deployment and runtime bytecode, it finds the exact offset by matching the first 20 bytes of runtime within deployment. This is fast, reliable, and works regardless of how the bytecode was compiled.

@EmperorOrokuSaki
Copy link
Member Author

dont merge yet

Base automatically changed from function/call to codebase/refactor October 26, 2025 12:52
Base automatically changed from codebase/refactor to master October 26, 2025 12:57
@g4titanx g4titanx closed this Nov 3, 2025
@g4titanx g4titanx reopened this Nov 3, 2025
@EmperorOrokuSaki EmperorOrokuSaki added the Urgent Needed for the next milestone label Nov 3, 2025
@g4titanx g4titanx force-pushed the fix/runtime_section_detection branch from 7cde3da to 0d44544 Compare November 24, 2025 13:32
Copy link
Member

@g4titanx g4titanx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to date!

@g4titanx
Copy link
Member

@ozwaldorf minor review, basically just this commit

@g4titanx g4titanx requested a review from ozwaldorf November 24, 2025 13:34
@EmperorOrokuSaki
Copy link
Member Author

i cant review because i opened the pr. @ozwaldorf

@g4titanx g4titanx merged commit f67aefc into master Nov 24, 2025
3 checks passed
@g4titanx g4titanx deleted the fix/runtime_section_detection branch November 24, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Urgent Needed for the next milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants