haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Fix resultBuilt(dirty mechanism) in hls-graph

Open soulomoon opened this issue 1 year ago • 6 comments

Fix #4237 resultBuilt might updated to an older value, which make a rule result that should be clean back to dirty. It might trigger un-needed recomputation. Fixing it could minimize the recomputation further.

soulomoon avatar May 17 '24 10:05 soulomoon

Do we have any tests for this mechanism? hls-graph is reasonably stand-alone, I would hope we could write a test for this?

michaelpj avatar May 17 '24 11:05 michaelpj

this seems to make sense. how did you discover this?

wz1000 avatar May 17 '24 11:05 wz1000

Actually, I've discovered the Changed and Built are somewhat off when fixing the dritiness hiding problem, but I forget about it at the time since it it won't hide the dirtiness but instead increase the chance of it. I am reviewing the code and it comes back to me.

Yep, I'll see if some test could be added.

soulomoon avatar May 17 '24 12:05 soulomoon

I've added two test, one from the lower level and one from higher level to demonstrate the bug and ensure no regression.

soulomoon avatar May 17 '24 15:05 soulomoon

I'd like @wz1000 to check the tests make sense just to be sure!

michaelpj avatar May 18 '24 11:05 michaelpj

nag @wz1000

michaelpj avatar May 28 '24 09:05 michaelpj

Let's merge it if no one object to this. I've been using this branch and no regression yet. And the bench reuslt look pretty promising

soulomoon avatar Jun 03 '24 07:06 soulomoon