Jump to content
  • Advertisement
  • entries
    628
  • comments
    1454
  • views
    1010731

Self-hosting the Epoch Compiler: Day Four

Sign in to follow this  
ApochPiQ

748 views

Mostly hammering away on a variety of miscompiles and other tiny bugs tonight; I've squished a ton of problems but they all blur together and I can't clearly remember what all they were.

Almost everything at this stage manifests as the JIT engine vomiting when trying to turn the compiled Epoch program into LLVM bitcode (for eventual translation to machine code). Sadly, this means it takes a disproportionate amount of digging around in various bits of code to pin down the exact reason for a miscompile.

Something that's scaring me a lot is that many of the bugs I find in the compiled program are not reproducible in smaller test cases. That tends to suggest a nasty problem in the compiler itself, since it should theoretically always be possible to recreate a miscompile in a controlled experiment.

Without small test cases to validate that compiler bugs are really fixed, it's extremely hard to know if I'm actually making progress or just pushing the bugs around into different areas. Since it takes a couple of minutes to produce a compiler binary, there's a lot of downtime and context switching.

My brain is pretty tired today and I'm honestly not sure how much dedication I have tonight.

Some of the bugs are just so bizarre that I'm deciding to punt on them when possible; there'll be plenty of time in the future to hunt them down and hopefully get regression tests into the test suite. I'm pretty much only fixing things that reflect large-scale issues or would affect too much code to work around them.

Unfortunately, it looks like one of my attempted fixes has actually had me going in circles, because it introduced a different bug that broke in a totally different way. Trying to fix the new bug led to undoing the fix, which in turn created the old bug again. Argh!

[Ed. Note: I fell asleep shortly after this.]
Sign in to follow this  


1 Comment


Recommended Comments

This is pretty much my least-favourite part of software development. The endless chasing around in circles after bugs that only reproduce in the running system... Good luck!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!