Update on next release

Discuss ADFFS development and download test releases
Vanfanel
Posts: 576
Joined: Mon Sep 16, 2013 12:01 am

Re: Update on next release

Post by Vanfanel »

Didn't have time to test today! Will try to start testing tomorrow, really.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

Vanfanel wrote:Didn't have time to test today! Will try to start testing tomorrow, really.
Its a bit buggy at the minute, as you can tell from the list above, I'll attempt to get it resolved tonight so you can help with blitzing the testing tomorrow. If we both hit it, you on the Pi, me on StrongARM we'll get it done a lot quicker.
JonAbbott wrote:I've spotted some code leakage between the builds, which is down to a compile bug. I'll spend today going through the whole code base to resolve this and see if it's the cause of the problem.
Spent a few hours debugging today and found an issue with the branch walkers interaction with CLib. That's now corrected, but it's highlighted another more fundamental issue I need to resolve. It shouldn't be an issue, its related to how ADFFS handles illegal instructions and illegal branches which are inevitable when predicting branches in self-modifying code and jumps to appspace where code hasn't been loaded yet.

I've also spotted another bug that's causing Battle Chess to crash when the branch prediction is turned off that I need to investigate.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

JonAbbott wrote:I've also spotted another bug that's causing Battle Chess to crash when the branch prediction is turned off that I need to investigate.
I was up until 3:30am debugging this issue last night, it's the Unsqueeze module that's actually crashing - not ADFFS. It's trying to write to FFFFFxxx for some reason.

ADFFS is the root cause however, as rolling back the code two weeks resolves the problem. I've ruled out the Abort handler, GOARM3JIT command and hypervised SWI code which are the main three that would affect this, so now need to pick through the hundreds of smaller changes in around 40 other files.

I'm seeing the problem under emulation as well, so we can rule out caching as well. Register/Stack corruption is my best guess as the cause.

Have just ruled out ldr, str and ldr_check. b, bl, core and codelets are the only code changes left to check.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

JonAbbott wrote:I've also spotted another bug that's causing Battle Chess to crash when the branch prediction is turned off that I need to investigate.

... b, bl, core and codelets are the only code changes left to check.
The problem is in "b" - the code that handles the Branch instruction. I suspect its thinking a branch to CLib needs walking, should hopefully have this fixed soon, then need to diagnose the branch prediction that's breaking the other game. The two issues may well be related.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

JonAbbott wrote:The problem is in "b" - the code that handles the Branch instruction. I suspect its thinking a branch to CLib needs walking, should hopefully have this fixed soon, then need to diagnose the branch prediction that's breaking the other game. The two issues may well be related.
It was indeed trying to walk CLib and is now fixed. The two issues are also related, so I'm working on the other problem now and will then upload a new version to the dev site for testing.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

@Vanfanel - I've uploaded revised versions of all modules to the dev site (/development/32bit/CPU) which have resolved the two issues above, overwrite the main ZIP files with these.

There is another issue though, as Battle Chess hangs whilst swapping discs. I'm going to quickly test the games above and update their status.

EDIT: Still cream crackered, thought I had it resolved as it's working under emulation. Back to the drawing board I'm afraid as even after turning off branch prediction it's broken :roll:
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

@Vanfanel - I've uploaded revised versions of all modules to the dev site (/development/32bit/CPU) which have resolved most issues, overwrite the main ZIP files with these.

There's still a problem with CLib games which I'm looking into.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

Have now corrected two bugs. One in the Branch Prediction and another in the Cache optimization. Full cache invalidation is now substantially reduced:
BeforeAfterDescription
>473>457Number of times the JIT was entered, down by 4%
I:4915I:4912Number of Instructions the JIT has had to looked at
R:1042R:1057Number of Instructions the JIT has re-encoded
L:342L:342Number of LDR's it's had to check for page zero reads
C:85C:2Number of full Cache flushes required
#:525#:522Number of codelets created
New branch prediction 4 linear, 8, 128 15-04-02_sm.png
The issues listed in this post are now consistent under emulation, so I can rule out cache issues.

@Vanfanel - I've uploaded the revised Modules to the dev site (/development/32bit/CPU)
regin
Posts: 9
Joined: Wed Oct 30, 2013 10:00 am

Re: Update on next release

Post by regin »

What an incredible thread. Just want to say how grateful I am that you continue to devote so much time and expertise to this project. Thank you.
JonAbbott
Posts: 2938
Joined: Thu Apr 11, 2013 12:13 pm
Location: Essex
Contact:

Re: Update on next release

Post by JonAbbott »

regin wrote:What an incredible thread. Just want to say how grateful I am that you continue to devote so much time and expertise to this project. Thank you.
You're welcome, if you have any feedback let me know. Would you like more frequent posts? More technical detail? Less? More pictures?

I keep meaning to put videos up on eBay to show games running on the Pi, but spend so much time programming, I never seem to find the time to configure the capture device - let alone play the game and capture it! I'll nag my son tomorrow - he's the YouTube expert and it's his capture device ;)

Latest update is that I believe there's one or possibly two bugs remaining. After correcting an issue with the BL instruction yesterday I noticed the JIT was turning itself off after Cannon Fodder loads, secondly the UnsqueezeAIF Module on RISCOS 5 is crashing when expanding various AIF based games. I noticed a recent update to RISCOS to fix a bug in this so need to see if it's the OS or ADFFS causing it. I'm not seeing the problem on RISCOS 3.71 but it's hard to tell when there's so many other factors involved, such as cache, vector handlers, etc.
Post Reply