EXAPUNKS

EXAPUNKS

View Stats:
Sawayama Wonderdisc thoughts
I recently was looking closer into this puzzle. My solutions all range from about 6.5-8k, none of them feel very efficient.

Also, codewise, entering the 'unlock' key is simply a list of COPY $VAR #AUTH statements, where the $VAR is hardcoded, so not very elegant.

Anybody any suggestions on making entering the code a little less clunky?

Now. The biggest challenge is of course that you have to TEST every value for being a region code, so that makes that you need to read them twice (once for testing, once for transfer). And you also have to check for EOF (either sending or receiving)

Parallelization I find myself stymied, since some files will process a lot faster than others, so it's hard to guarantee order.

Anybody any suggestions to cut some serious cycles here? A way to process more parallelly?

Currently all my approaches are a variant of just having one EXA read from the example files and send them over M to a 'writer' EXA, with either at the sending or receiving end the TESTs being done for EOF and regioncode.
< >
Showing 1-7 of 7 comments
Originally posted by thewifiwhisperer:
I recently was looking closer into this puzzle. My solutions all range from about 6.5-8k, none of them feel very efficient.

Also, codewise, entering the 'unlock' key is simply a list of COPY $VAR #AUTH statements, where the $VAR is hardcoded, so not very elegant.

Anybody any suggestions on making entering the code a little less clunky?

Now. The biggest challenge is of course that you have to TEST every value for being a region code, so that makes that you need to read them twice (once for testing, once for transfer). And you also have to check for EOF (either sending or receiving)

Parallelization I find myself stymied, since some files will process a lot faster than others, so it's hard to guarantee order.

Anybody any suggestions to cut some serious cycles here? A way to process more parallelly?

Currently all my approaches are a variant of just having one EXA read from the example files and send them over M to a 'writer' EXA, with either at the sending or receiving end the TESTs being done for EOF and regioncode.
Not sure I have a real answer for you. Mostly just sympathy.

I have the same problems. I just can't seem to cut down on the cycles. About the best I've been able to do is around 6000.

Sounds like our solutions are very similar. I don't see any way to avoid testing for region code and EOF.

I'm not sure how to set it up, but it appears possible to have two EXAs each reading a track. At the same time. If you can figure it out you'd probably cut the cycles by 40-50%.
I don't think this will help you, but the one thing that made this one at all workable for me was the ability to compare a string to an integer and always come up false. Even with that, the solution felt a little clunky, but not too bad.

Entering the unlock code is just a brute force-ish thing. I see that kind of thing in real-life code all the time, usually when the code is written by an electrical engineeer rather than a computer scientist. (Not saying it's wrong, sometimes the engineering solution is smarter than the CS solution... like the 'zine says, "sometimes stupid code is smarter code.")
I have a ~1500 cycle solution and can give you some tips!

Regarding the auth key, there's not much you can do better than hard coding. To save some lines, you can do

COPY 3 T MARK ENTER SWIZ 811 T #AUTH SWIZ 002 T #AUTH SWIZ 345 T #AUTH SWIZ 292 T #AUTH SWIZ 756 T #AUTH MODI -1 T T JUMP ENTER

though the gain is unlikely to matter much until you get down to <2000 cycles.

Now, to tips that can have a larger impact. Your idea about processing in parallel is definitely the way to go. That is, separating the code for sending and the code for overwriting. As you correctly note, some files are processed faster than others, which means that they will lose their order. You will have to find a way to get them ordered again. One idea is to buffer them in HOME, and have a separate exa that grabs them in order. For example by trying to grab 400 until it succeeds, then 401 etc .

Doing this correctly should net you 2000-3000 cycles, maybe even <2000. A key component to get there is unrolling. You know that each file is a multiple of 12, which means that you only need to check for EOF after 12 sends. In other words, you can have 12 "COPY F M" in a row, giving you almost a 1 entry per 2 cycle copy. You'll need to figure out a neat way of knowing when to stop sending. The way I'm doing it is to Have the sender do no tests, so simply MARK L (COPY F M) * 13 JUMP L, while the receiver checks if the sender has crashed every 12 writes, using TEST MRD. This gives you 12 writes in 25 cycles.

For less than this you need to start having two writes at once, one using LOCAL and one using GLOBAL. This is pretty difficult to set up, since you will need to consider that sometimes the same file is used twice in a row.
I've managed to get 6.3k now, by first counting the multiple of twelves to be sent. This doesn't cost too many cycles. I then transmit that number and store it in T of the receiver, allowing for a nice and efficient transmission loop without need for TEST EOF or TEST MRD. (Just a SUBI T 1 T after every 12 receives).

I previously had a variation of the 13 SENDS & 12 RECEIVES + TEST MRD, works like a charm, too, similar 6.5k range.

What I really do like is your suggestion of just doing the parallel processing, and keeping track of order separately, rather than depending on sequentiality. That makes so much sense.

(Another thing I was considering, which one should be able to pull off, if barely, due to space constraints, is to first make copies of all original files with the region code replaced. Then each time copy those 'you prepared earlier' instead. Thing is that you have about 30 tracks to copy in total, so the question is whether 3x10 'on-the-fly replacement' copies is truly that much slower than 1x10 'on-the-fly' copies + 3x10 'prpared earlier' copies. I hope this calculation makes sense).
Ok, I did the last bit, basically, I make a copy of every file in the 'protected area', but with the region code replaced with 'SSEA'. Because of space constraints, I store 8 of them in 'home' and the other 3 in the middle area.

Then from that moment I start getting the #TRAK numbers and transferring them 'fast' to a receiver in the buffer area.

I did run into code length issues (so used a variation of the SWIZ trick from @BACARDI) and can probably clean up some of the stuff. The first results of this approach are +- 4k cycles. (SO. PROUD.) So I'm happy with that :-)

I'm having trouble getting an approach with 'maintaining order' to work. I did peek at your spoiler, so have a better idea how it might work.

Anyway, just a thank you @BACARDI for your suggestions and @estyles31 and @Jackie Daytona for their sympathies :-)
I like your solution a lot! I actually tried something very similar to break the cycles record before I landed on my current solution. The idea was that the last time a file was used, it could be sent in directly without copying, saving a lot of work. I'd also have to do a lot of copying in parallel, which turned out to be too much for the size constraint.

A final tip for the ordering part: You can have an exa create a REPL that tries to grab a file with ID stored in X (starting at 400). If it succeeds, it sends a value over M. The exa that created the repl performs TEST MRD to check if a file was grabbed, and if so, increments X by 1
Yeah, at first I had been thinking of a 'caching' solution, but since you have to copy it twice anyway, there's little to be gained there, I think.

I polished my solution a bit, and managed to get it from slightly over 4k to slightly under. There's some trade-offs specifically due to code size I have to make.

https://steamcommunity.com/sharedfiles/filedetails/?id=2144149347
< >
Showing 1-7 of 7 comments
Per page: 1530 50