Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > CSDb Entries > Release id #115758 : Bongo Cruncher
2013-04-28 01:09
Urban Space Cowboy

Registered: Nov 2004
Posts: 45
Release id #115758 : Bongo Cruncher

I'm happy to say that after some experimentation, I've got Exomizer + a straightforward delta coder/decoder to beat Bongo Cruncher!

How does this work? The uncrunched program contains a ton of unrolled loops repeating every 3 or 6 bytes. I got the best results with a delta encoding of addresses six apart ($0807 is replaced with $0807-$0801, $0808 with $0808-$0802, $0809 with $0809-$0803, and so on). The routine at $07e1 reverses the delta encoding then starts the demo. The demo is a part from "I Love the Cube" that uses drive code, so you'll need a 1541 drive attached.

How well does this improve on Bongo Cruncher's "lovely golden sequences"? A few bytes that don't save any blocks? Nope. A block or two? Nope. 19 BLOCKS. And the exomizer-crunched version actually decrunches a bit faster -- about 8 seconds versus bongo2passgolden's 12 seconds.
29297 bytes (116 blocks) bongo2passgolden
24581 bytes  (97 blocks) demodatad6.exo
Check it out:
demodatad6.zip - 53.4 Kb
2013-04-28 06:39
doynax
Account closed

Registered: Oct 2004
Posts: 212
You say that as if it's some sort of achievement.

No cruncher is universal and a bit of data-specific preprocessing to help out is the generally accepted method of achieving decent compression ratios at reasonable speeds.

I'd be more interested to hear how Bongo Cruncher with delta coding compares. Or any others for that matter.

In fairness I should say that good preprocessing techniques relies on deep knowledge of how the compression algorithms work, which I should think may be more of a problem in terms of the Bongo Cruncher.
2013-04-28 07:15
Burglar

Registered: Dec 2004
Posts: 1102
Quote:
The uncrunched program contains a ton of unrolled loops repeating every 3 or 6 bytes

I'd guess that you'll get an even better result if you write codegenerators for the unrolled loops.
2013-04-28 10:31
Krill

Registered: Apr 2002
Posts: 2980
Plus code compresses better when you separate op-code and operand streams.
Also i'd say that the gold standard to compare pack ratios against is still Exomizer.
2013-04-28 11:22
Urban Space Cowboy

Registered: Nov 2004
Posts: 45
Quoting doynax
I'd be more interested to hear how Bongo Cruncher with delta coding compares. Or any others for that matter.
Well, that was motivation enough to learn how to compile Delphi Pascal. (In cruncher.dpr, add {$MODE DELPHI} above {$APPTYPE CONSOLE} -- then compile using Free Pascal: fpc -ocruncher cruncher.dpr)
24958 bytes (99 blocks) cruncher -i demodatad6.o -DepackAdr '$07dd' -o d6test1p.prg -prgfile -JMP '$07e1' -Value01 '$38' -nogoldenseq
24875 bytes (98 blocks) pucrunch -x0x7e1 +f -g0x38 -i0 -r59126 -fdelta demodatad6.o demodatad6.pu
For comparison, results on the original uncrunched file without delta encoding:
40003 bytes (158 blocks) pucrunch -x0x801 +f -r23107 -p1 -m6 -fdelta demodata.prg demodata.pu
34124 bytes (135 blocks) exomizer sfx 0x801 -q -t64 -Di_irq_exit=0 -Di_ram_exit='$38' -m26365 -M174 -n -o "$FILE" demodata.prg
29297 bytes (116 blocks) cruncher -i demodata.prg -DepackAdr $0801 -o bongo2passwithgoldenseq.prg -prgfile -JMP '$080D' -Value01 '$37' -iterate
2013-04-28 11:53
iAN CooG

Registered: May 2002
Posts: 3198
why -m26365 -M174 in exomizer? doesn't those switches always lead to worse compression? what is the result omitting those switches?
anyway, if you used a simple charpacker like IDIOTS Fx Bytepacker V2.1 then Rowscruncher V1.0 and finally exomize it you get 22283 bytes instead of 24581. Of course it takes a bit more to unpack.
2013-04-28 15:24
Urban Space Cowboy

Registered: Nov 2004
Posts: 45
Quoting iAN CooG
why -m26365 -M174 in exomizer? doesn't those switches always lead to worse compression? what is the result omitting those switches?
No, not always. Sometimes there're edge cases where the "best" options give you slightly worse results, even after the optimization passes. I used a shell script to brute-force try different -m and -M options, same with -r for pucrunch.
34138 bytes (135 blocks) exomizer sfx 0x801 -q -t64 -Di_irq_exit=0 -Di_ram_exit='$38' -n -o blargh.exo demodata.prg

Quote:
anyway, if you used a simple charpacker like IDIOTS Fx Bytepacker V2.1 then Rowscruncher V1.0 and finally exomize it you get 22283 bytes instead of 24581. Of course it takes a bit more to unpack.
Thanks for the pointer, it's nice to know other people've experimented along similar lines before. More ideas to pillage!
2013-04-29 17:27
Bitbreaker

Registered: Oct 2002
Posts: 508
lzma squeezes the demodata.prg down to 24776 bytes, but i guess it is PITA to write a fast and small decruncher for that? :-) One might start with PackFire 1.2h or such. Here would be some decompressors, but none for 6510 yet: http://jiggawatt.org/badc0de/decrunch/
2013-05-06 07:11
Bitbreaker

Registered: Oct 2002
Posts: 508
Quote: Plus code compresses better when you separate op-code and operand streams.
Also i'd say that the gold standard to compare pack ratios against is still Exomizer.


Most likely yes, but also consider that there is sometimes speedcode that is better generated on PC-side, as it is too complex or complex or memory/time intensive to generate it. In the sphere mapper i did for coma light 13 i incorporated the mapping as well as register reuse and such into the speedcode. That is already a mess in C, there's no urge to work that out in 6502, despite my autistic affection :-)
2013-05-06 10:27
Krill

Registered: Apr 2002
Posts: 2980
Quoting Bitbreaker
In the sphere mapper i did for coma light 13 i incorporated the mapping as well as register reuse and such into the speedcode. That is already a mess in C, there's no urge to work that out in 6502, despite my autistic affection :-)


Yes, i know what you mean. :)
The lens effect in +H2K also loads pre-generated speedcode from disk, also with optimized mapping and register re-use.
At some point generating it before running the effect took way too long on C-64, so i simply saved it for the final version rather than generating it.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
aNdy/AL/Cosine
E$G/HF ⭐ 7
saimo/RETREAM
Dr. Doom/RAD
Worluk
Paul Bearer
Airwolf/F4CG
Guests online: 118
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 X-Mas Demo 2024  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Diskmag Editors
1 Magic  (9.8)
2 Jazzcat  (9.5)
3 hedning  (9.4)
4 Elwix  (9.1)
5 Remix  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.053 sec.