Skip to content

Fix undumped locs#112

Merged
ltratt merged 2 commits intoykjit:mainfrom
vext01:fix-undumped-locs
Apr 3, 2025
Merged

Fix undumped locs#112
ltratt merged 2 commits intoykjit:mainfrom
vext01:fix-undumped-locs

Conversation

@vext01
Copy link
Contributor

@vext01 vext01 commented Apr 2, 2025

See commits.

Note that this comes with a caveat, explained in the second commit. Hence this is a draft.

@ltratt
Copy link
Contributor

ltratt commented Apr 2, 2025

This smells like a probable problem that Richards is highlighting and that we need to at least somewhat understand.

@vext01
Copy link
Contributor Author

vext01 commented Apr 2, 2025

After investigating a bit, I think the richards slowdown is unrelated to this change:

  • this change only affects programs that dump or undump functions. richards does not.
  • even on the main branch if you repeatedly run richards, sometimes you get a slow run with much longer traces

I don't see any obvious non-determinism in richards, so my vague guess is that the non-determinism comes from yk (timings and the such).

I think we should merge this and then I can revert to the hot location debug work and see if it shines any light on what's going on with richards.

Would you be ok with that?

vext01 added 2 commits April 3, 2025 13:38
Before, we'd make a location for *every* pc in an unmdumped function.
This could lead to us tracing too much.

This fixes this by using the same heuristics that we use for normal
"parsed" functions to decide where loops start, and thus where to put
yk locations.

(Ideally we'd dump and undump the locations, thus retaining JIT state,
but that could be tricky. One for another day)

In terms of performance, most benchmarks either don't change, or speed
up a little bit (in the order of 5%).
@vext01 vext01 force-pushed the fix-undumped-locs branch from 7fad073 to d8f1373 Compare April 3, 2025 12:38
@vext01 vext01 marked this pull request as ready for review April 3, 2025 12:39
@vext01
Copy link
Contributor Author

vext01 commented Apr 3, 2025

Force pushed commit message update and added a comment about one day making the locations survive a dump+undump.

I think this is ready to merge if you are happy with it.

@ltratt ltratt added this pull request to the merge queue Apr 3, 2025
Merged via the queue into ykjit:main with commit 7aa770d Apr 3, 2025
2 checks passed
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