English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 04 March 2012, 21:33   #1
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Question Bug with AMOS 3D in newer WinUAE

I have noticed a bug in WinUAE when running AMOS 3D programs using Fastest Possible CPU + JIT (with Vsync disabled), which involves some graphical corruption.

From my testing, this bug was introduced in WinUAE 2.3.2 (2011.06.02).
WinUAE 2.3.1 (2011.02.26) and earlier do not have this bug.

I enclose a zipped ADF test which reproduces this bug, as well as WinUAE logs from version 2.3.3 and the configuration used, as well as a screenshot.

I can confirm that this bug is still current in the latest WinUAE 2.4.0 beta 20 (2012.03.04).
I am hoping it can be fixed in final 2.4.0 release. (I want to create an updated AMOS for Windows emulation pack.)

Mequa


P.S. Enabling the new Vsync fixes this problem, however performance decreases drastically with this example and other AMOS 3D programs. Perhaps performance with the new Vsync can also be investigated.
Attached Thumbnails
Click image for larger version

Name:	Bug.png
Views:	260
Size:	32.7 KB
ID:	30700   Click image for larger version

Name:	NoBug_WinUAE231.png
Views:	273
Size:	25.8 KB
ID:	30701  
Attached Files
File Type: uae AMOS3Dbugtest.uae (7.5 KB, 157 views)
File Type: zip AMOS3Dbugtest.zip (433.4 KB, 160 views)
File Type: txt winuaebootlog.txt (11.3 KB, 149 views)
File Type: txt winuaelog.txt (6.1 KB, 154 views)

Last edited by Mequa; 04 March 2012 at 21:45.
Mequa is offline  
Old 05 March 2012, 08:19   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
JIT and fastest possible timing can and will change between versions. Not a bug, sorry. (Does immediate blitter fix it?)

To test 2.4 vsync:

Use sysinfo (yes, it is quite useless normally but works fine in this test) or some other speed test program and compare speed results using 2 following setups:
- fullscreen + low latency vsync vs no vsync, fastest possible (no JIT)
- fullscreen + low latency vsync vs no vsync, and JIT.

First make working copy of your configuration and before each test, restart winuae, load same configuration and change vsync/buffer option only. Do not touch anything else.

Use standard 60Hz refresh rate (It is guaranteed to work, other refresh rates may do something unexpected..) Try all buffering options. Save logs (winuaelog.txt only) from all vsync tests.

Thanks.

In my tests I get about 10-15% speed loss in JIT modes when using vsync. It is not possible to have full speed in vsync modes.
Toni Wilen is offline  
Old 05 March 2012, 09:39   #3
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Immediate/original blitter doesn't seem to make much difference. The above uses A4000/040 quickstart options with immediate blitter enabled.

The above glitches also occur with fastest possible CPU without JIT, but to a much lesser extent. Downgrading to WinUAE 2.3.2 or earlier completely removes the above glitches.

Correction to above: New Vsync reduces this glitch, but it still occurs.

P.S. Speed loss in the above program (and other AMOS 3D ones) is MUCH more than 15% with new Vsync. It seems to run around 30% of the non-vsync speed.

Last edited by Mequa; 05 March 2012 at 10:06.
Mequa is offline  
Old 05 March 2012, 12:44   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
In my opinion drastically is much much more than 30%. Hard facts and numbers only accepted

You can test which 2.3.3 beta introduced the JIT issue if you are interested.. But I am quite sure it is simply working as designed.
Toni Wilen is offline  
Old 05 March 2012, 19:24   #5
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
I think the glitch was introduced in one of the 2.3.2 betas. Where can I download them to test, since I narrowed it to that?
Mequa is offline  
Old 05 March 2012, 19:30   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Check old beta threads. All betas since 2.1 are still available.
Toni Wilen is offline  
Old 05 March 2012, 19:47   #7
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Never mind, I found all 8 of them here: http://eab.abime.net/showthread.php?t=58121

The glitch was introduced in 2.3.2 beta 4. All betas after that have the glitch, 2.3.2 beta 3 and earlier work fine.

I'm wondering if it's this modification in beta 4 which caused the issue:
"Stop the cpu and wait until blitter has finished if any blitter register is accessed while blitter is busy and cpu mode is fastest possible".
As stated, setting immediate blitter does not fix the glitch, so this appears to also affect immediate blitter.
(I know AMOS 3D makes heavy use of both the CPU and blitter, it requires fastest possible CPU + JIT + immediate blitter + disabled Vsync for best performance.)

If it is this which causes issues, could it possibly be moved to config options?
(Perhaps a "CPU wait for blitter" checkbox, on by default?)

Last edited by Mequa; 05 March 2012 at 20:05.
Mequa is offline  
Old 05 March 2012, 19:55   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Create minimal archive that includes required AMOS stuff (no WB files) and I'll take a closer look.
Toni Wilen is offline  
Old 05 March 2012, 20:25   #9
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Floppy disk Test archive

What is required in the archive? I included an ADF which boots into a CPU-heavy AMOS 3D demo which demonstrates the glitch (in AMOS3Dbugtest.zip), would you like its files in an archive?

I added an archive below containing the same demo (recompiled to include amos.library), this one should work from the folder when extracted. Its AMOS source is also included.

Other than the 3DOBJECTS directory and compiled demo binary itself, the only required file included is c3d.lib (for compiled AMOS 3D programs).
Attached Files
File Type: zip AMOS3DBugTest.zip (80.0 KB, 154 views)

Last edited by Mequa; 05 March 2012 at 20:39.
Mequa is offline  
Old 06 March 2012, 08:16   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
I missed the included adf, I wasn't expected it to be included already

btw, does older versions work with immediate blitter? (It would be really bad if it requires disabled immediate blitter..)
Toni Wilen is offline  
Old 06 March 2012, 09:21   #11
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Yes, immediate blitter has always worked well with AMOS including 3D extension.
Mequa is offline  
Old 06 March 2012, 18:48   #12
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
It was a bug in that 2.3.2 fastest possible CPU blitter update and quite stupid bug as usual..

This bug was triggered by amos bug, it calls graphics.library OwnBlitter() and then writes to some blitter registers, without waiting for blitter. OwnBlitter() does not wait, it is very clearly said in documentation.

btw, amos blitter line draw code is horribly ineffective and other code isn't much better.. (Unfortunately I had to disassemble it to find this problem...)
Toni Wilen is offline  
Old 06 March 2012, 21:21   #13
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Is this bug and inefficient line drawing in AMOS itself or AMOS 3D extension (c3d.lib)?
I knew the 3D engine was pretty crap.

Thanks for investigating!
Mequa is offline  
Old 07 March 2012, 16:46   #14
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by Mequa View Post
Is this bug and inefficient line drawing in AMOS itself or AMOS 3D extension (c3d.lib)?
I knew the 3D engine was pretty crap.

Thanks for investigating!
I don't know, I only looked at disassembly, I have no idea where the code came from

btw, do the vsync test, please. I need to know if some simple test (like sysinfo, make sure to run each test at least 3 times and ignore possible strange results that only appear once) shows the same slowdown or if it only happens when something more complex is happening.
Toni Wilen is offline  
Old 07 March 2012, 18:16   #15
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Does http://www.winuae.net/files/b/winuae.zip run any faster in fastest possible + low latency vsync modes?
Toni Wilen is offline  
Old 07 March 2012, 20:56   #16
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
I couldn't see much of a speed increase - it's still quite a bit slower than half the speed without the new vsync (my game Operation Gigabyte has its own FPS counter, the game's reported difference is 50FPS without vsync to 17FPS with vsync, still running at 50FPS internally according to WinUAE) - but the graphical glitches are gone!
Mequa is offline  
Old 07 March 2012, 21:01   #17
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by Mequa View Post
I couldn't see much of a speed increase - it's still quite a bit slower than half the speed without the new vsync (my game Operation Gigabyte has its own FPS counter, the game's reported difference is 50FPS without vsync to 17FPS with vsync, still running at 50FPS internally according to WinUAE) - but the graphical glitches are gone!
Ok, attach some program that includes FPS counter (much easier to compare than watching animation speed), thanks.

It appears this requires some specific condition because I can't see any major JIT + vsync slowdowns and I have tested it on 3 different PCs, which includes one crappy laptop that can't even run cycle-exact A500 full speed..
Toni Wilen is offline  
Old 07 March 2012, 21:31   #18
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Floppy disk AMOS 3D demo with FPS counter

I attach a file archive of the same demo with an FPS counter added.
I get around 17 FPS without new Vsync and 7 FPS with new Vsync (both fastest possible CPU + JIT + immediate blitter).
New Vsync is even slower when using included AROS ROM (around 6 FPS).

Source included (in both .AMOS and Ascii format, for anyone interested).

Zipped ADF version also included (autobooting, also works with AROS ROM).
Attached Files
File Type: zip AMOS3DBugTest2.zip (83.2 KB, 233 views)
File Type: zip AMOS3Dbugtest2ADF.zip (440.6 KB, 229 views)

Last edited by Mequa; 07 March 2012 at 21:44.
Mequa is offline  
Old 08 March 2012, 19:29   #19
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Thanks, I can finally confirm it.

JIT gets slow, fastest possible without JIT works normally.

I am not sure what happens but it seems there is some strange JIT trick in custom emulation code which does not make sense. JIT slows down even in non-vsync mode (exact same slow speed!) if this weird code is disabled...

EDIT: It finally makes sense, I think this slowdown can be fixed!

Last edited by Toni Wilen; 08 March 2012 at 20:44.
Toni Wilen is offline  
Old 09 March 2012, 20:42   #20
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
http://www.winuae.net/files/b/winuae.zip should finally fix low latency vsync + fastest possible (with or without JIT) slowdown.

Beta coming tomorrow if no new issues found. This update changed code that I haven't really touched (or even fully understood until now), it may cause surprises..

One nice side-effect is non-JIT fastest possible CPU being now faster (possibly much faster) than previously.

EDIT: funnily enough both JIT and non-JIT fastest possible modes + immediate blitter are faster than previous JIT mode in older versions, even in non-vsync mode!

Last edited by Toni Wilen; 10 March 2012 at 08:54.
Toni Wilen is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
AMOS for Windows installer using AROS-68K and WinUAE Mequa News 32 04 May 2017 09:08
Amos Pro programming on WinUAE CaptainNow Retrogaming General Discussion 26 07 April 2015 14:04
Winuae bug BippyM support.WinUAE 29 22 November 2012 19:12
Bug Winuae Zollex support.WinUAE 7 03 August 2007 20:52
Bug in winuae Paul support.WinUAE 4 06 June 2003 20:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:04.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09701 seconds with 16 queries