|
Part 37 - Holman Dynamics === Trash World Inbox === Last time, I fixed my eye with some hacks, getting high scores of 334, 29, and 10. silentsnack has both a cycle and lines of code improvement. silentsnack posted:
There's some clever mathematics tricks though. The DIVI directly returns 0 or 1 based on the #NERV value. The first M call from the cortex EXA subtracts 15 (which is 75 / 5) so that's another two steps in a single cycle. silentsnack posted:
=== Holman Dynamics - Sales System === Hopefully this is the last time you'll have to hack yourself like this. Three votes for "I hope so", one for each of the other options. I hope so. Maybe you'll come upon a solution to that. Some way to keep from having to physically go in and fix yourself every so often... I wonder what that would entail. Something to think about. I met with Ghast, and Ember gave me a new assignment. Ah, and that happened too, I suppose. The dataphones were cute, but I still need more computing power. We need to get me some significant hardware upgrades. Everyone voted for the same option here. I assume you have some kind of plan. Of course. We're going to buy a supercomputer. With credit cards. Specifically, credit cards that were used to buy supercomputers before. It'll be less suspicious that way. Someone who buys one supercomputer maybe buys two. Right? Seems plausible to me. If you say so... OST: Network Exploration The assignment: - Create a file in your host containing the contiguous 16-value sequence from the garbage file (file 199) that is a valid credit card number. There will be exactly one such sequence. - For more information see "How to Validate Credit Card Numbers" in the second issue of the zine. This assignment allows for a max size of 150 lines of code. That's quite high, so this one might get complicated. I opened up some random files for the screenshot. Other than the garbage file, there are "leads" (e.g. file 224, according to the host name), "accounts" (file 201), and "receipts" (e.g. 262). But all we need is the garbage file. Let's check the zine. Summarized, to validate a 16-digit number, sum all digits in a particular way. Take the digits in even positions as-is, for the odd ones double the value and if it's 10 or higher, subtract 10. Sum them up and if the result mod 10 equals zero, the number is valid. This is actually the real-life Luhn algorithm aka mod 10 algorithm, which is used to validate credit card numbers and lots of other id numbers in real life. Wikipedia's description of the algorithm is slightly different but the maths work out to be identical. I think this is a cool touch - and why invent your own algorithm if the real one works perfectly well for a puzzle. Looking at the file in more detail, those -9999 values help a lot. If there's less than 16 digits before a -9999 I know it will be invalid. What I can't tell yet is if would be faster to just start the algorithm and reset once we hit a -9999, or do a seperate initial pass so we know what values to skip and don't even run the algorithm on that. There's another potential complication - if there's more than 16 digits in a row, that might mean any window of 16 might be the number. We'll cross that bridge when we get to it. code:
I could copy the whole file to another EXA and have it do logic but all the M calls would be slow. So if XA can do at least some intermediate work before invoking M, that would help. After some trial and error I settled for this code in XA: code:
Now, XB has to do the actual work. code:
I then put in a 0 in the file and copy the 16 values from XA. The next step is the validation algorithm. code:
Then I repeat the same couple of lines 8 times, each repetition handles two digits. For the first (odd) digit, I multiply it by 2, do modulo 9 to remove a 9 if it's greater than that, and add it to T. The even digit can just be added directly. Finally, the modulo 10 check puts a 0 in T only if the number is valid. If the number is found, the program will jump to GOTIT. I'll show that branch first. code:
So how about if the credit card wasn't valid? Falling through from FJMP GOTIT: code:
Is this it? No, not quite. There is one edge case in which this solution fails. If an odd digit is exactly 9, it will be doubled to become 18, and 18 mod 9 equals 0, while the validation algorithm needs to get a 9 there. So, sadly, I can't use this particular MODI trick. A possible solution could be to add a specific X = 9 check, and a code branch that deals with that case. But since I'm already using both X and T, that would require some very awkward shuffling of values. I need something smarter. And for that, I actually looked at the original description of the Luhn algorithm. It says, if you double a digit, just add the resulting digits together. For instance 6 * 2 = 12, result is 1 + 2 = 3. Starting from any single digit value, the result of this operation is identical to just subtracting 9 from the doubled value. I just have to implement this efficiently. Is there a combination of operations, using my limited storage space, to do that? code:
I then SEEK back to the original value in the file, and do a DIVI F 5 X. If F is less than 5 this will return 0. If it's between 5 and 9 inclusive, it will return a 1. In other words, it will return the value in the tens place of the doubled digit. Add that to T as well and that's the edge case covered. Here is the full code. It runs at 3704/130/7, with top percentiles sitting at 1752, 42, 3. Before I do anything else, a tiny speed improvement that drops the solution to 3699, without changing the LoC. Instead of writing a 0 to F at the start, I can put a SEEK -9999 just before the VALIDATE mark, and put another one just above the JUMP VALIDATE, together with a VOID F there. With that out of the way, getting the activity down to 3 should be easy enough. code:
XB's LINKs are gone. XA tests if XB is sending something after each SENDREMAINING loop, and XB sends a message when it's done. XB does need to test if XA is sending something, because it is possible XA reached the end of the file and died already. I think the simplest way to reduce the size is by rolling up those loops. code:
The 16 iterations read and send loops just keep counters now. The validation loop uses an EOF to check when it's done. To do that test I did have to move the accumulator to X. I also changed the -9999 so it'd be tested directly against F. That allowed me to remove one of the COPY 0 X lines. As for reducing the cycle count, obviously from the top percentile, there are large improvements possible. One thing I tried is combining the 16 M sends with SWIZ operations. That doesn't really help because the true bottleneck here is that one EXA completely pauses waiting for the other when they're validating or trying to find credit card numbers. There are certainly ways to parallelize that, but since the basic solution was complex enough as it was, I'll leave that, together with further LoC optimizations, as an exercise to the reader. It turns out you can order and take delivery of a supercomputer surprisingly fast. Now I have to figure out how to make use of this thing... It works in an extremely different way than I'm used to. I feel like I'm trying to maneuver a big rig after years of being used to a roadster. That's a use of metaphor. What do you think? I think it's time for the first vote. It's the final hacker battle... Are you excited? Are you nervous? Hey, no spoilers, please, Ember. Anyway, the second vote.
|
# ? Aug 7, 2022 13:49 |
|
|
# ? May 5, 2024 07:20 |
|
Carbon dioxide posted:And for that, I actually looked at the original description of the Luhn algorithm. It says, if you double a digit, just add the resulting digits together. For instance 6 * 2 = 12, result is 1 + 2 = 3. Starting from any single digit value, the result of this operation is identical to just subtracting 9 from the doubled value. The reason this works is related to the ancient trick where, to test if a number is a multiple of 9, you just sum the digits repeatedly until you get down to one digit and see if the end result is exactly 9. When you sum the digits, you’re actually subtracting a multiple of 9, because 10 -> 1 is a change of 9, 100 -> 1 is a change of 99, 1000 -> 1 is a change of 999, etc. If you start with the number 837, for instance, you first add the digits to get 18… but what you’re actually doing is subtracting 8*99 + 3*9, which is of course a multiple of 9. So the digit-summing operation preserves the value mod 9. The reason it solves the problem you had here is that it has an additional quirk. 0 and 9 are indistinguishable mod 9, but in terms of the integers, digit-summing can never give you 0 (unless your original number was itself zero). This is because that 9-sum you’re subtracting is always strictly less than the number you’re subtracting it from, so the output is always strictly positive. In the case of the puzzle, the doubled digit can’t be greater than 18, so adding the digits is effectively subtracting 9 if and only if the answer was strictly greater than 9, as described in the zine. e: As a neat extension, digit-summing works in other bases just fine, it just gives you the value mod b-1. For instance, in hexadecimal, digit-summing tells you the value mod 15. megane fucked around with this message at 17:55 on Aug 7, 2022 |
# ? Aug 7, 2022 17:52 |
|
Could use some work Nah
|
# ? Aug 7, 2022 23:52 |
|
Voting for poetic and sure.
|
# ? Aug 8, 2022 01:49 |
|
Poetic and nah
|
# ? Aug 8, 2022 06:55 |
|
Poetic and Maybe a little...
|
# ? Aug 8, 2022 07:58 |
|
One optimization is after a successful test showing we have 16 consecutive digits that are all [0~9], if we move to the next set in the file we already know that 15 of its 16 digits have passed the "F = -9999?" test so we only need to test the newest digit. If you're searching forward then that means after reading the 16th value the next one in the file needs to be -9999?'d then you jump back 16. if you're searching backward from the end then it's even more straightforward but ... uh, we'll get to that later. Or for a low-line solution, we can replace the whole first-pass -9999? test with two lines, so long as we use a tweaked algorithm that produces a final checksum that is negative IFF any one of its digits is negative. code:
Also as you suggested it a solution can handle a lot of stuff over the M register which ends up being faster since we can freely overwrite the X/T registers of a clone and then let it crash which avoids having to read the file twice with a SEEK -1 between. Even with parallelization, fast solutions start hitting a limit around 1500 cycles without looking at the comparison at the end that shows individual times to solve each different run of the puzzle, but once again if you start from the end and search backward most testruns end up being fairly fast (indicating the valid credit card numbers are mostly toward the latter half of the file) but several end up taking much longer. One way to do this is to make a separate copy of the beginning of the garbage file, like in this example exactly the first 100 entries, and check that independently while another EXA starts at position 85 to catch the overlap. code:
The fastest solution I've managed searches backward from the end and instead of copying the file it handles the slowest/earliest cases with a goofy hack that takes advantage of the fact that testdata for each run can apparently be uniquely identified by the first 3 digits of the garbage file. code:
berryjon posted:Could use some work
|
# ? Aug 9, 2022 00:04 |
|
Very poetic Maybe a little
|
# ? Aug 9, 2022 22:49 |
|
Part 38 - Aberdeen === Trash World Inbox === While optimizations are getting much harder now, silentsnack still comes up with improvements. silentsnack posted:[...] for a low-line solution, we can replace the whole first-pass -9999? test with two lines, so long as we use a tweaked algorithm that produces a final checksum that is negative IFF any one of its digits is negative. silentsnack posted:Even with parallelization, fast solutions start hitting a limit around 1500 cycles without looking at the comparison at the end that shows individual times to solve each different run of the puzzle, but once again if you start from the end and search backward most testruns end up being fairly fast (indicating the valid credit card numbers are mostly toward the latter half of the file) but several end up taking much longer. silentsnack posted:The fastest solution I've managed searches backward from the end and instead of copying the file it handles the slowest/earliest cases with a goofy hack that takes advantage of the fact that testdata for each run can apparently be uniquely identified by the first 3 digits of the garbage file. silentsnack posted:... and here's the point where I say I'm not totally out of energy and giving up, simply choosing to leave figuring out how to parse this insane gibberish code as an exercise for especially bored readers. === Aberdeen === It turns out you can order and take delivery of a supercomputer surprisingly fast. Now I have to figure out how to make use of this thing... It works in an extremely different way than I'm used to. I feel like I'm trying to maneuver a big rig after years of being used to a roadster. That's a use of metaphor. What do you think? 4 out of 6 people found this poetic. Very poetic. Thanks. Once this thing is fully online I should be able to run dozens of metaphoric thought-space dimensions at once. Another hacker battle coming up. It's the final hacker battle... Are you excited? Are you nervous? One vote for sure, 2 for maybe a little, and 3 for nah. Nah. No reason to be. I am sure that you will do great. That's some more positive encouragement for you. I know how much it helps. Not if you keep pointing out it's positive encouragement. Let's just jump right in it. OST: Getting Started The assignment: To win this battle you must occupy a majority of the hosts for as long as possible. You occupy a host if you have more EXAs in it than your opponent. - Gain one point every cycle you occupy more hosts than your opponent. - Lose one point every time one of your EXAs executes a KILL instruction. Writing any value to the #NUKE register will destroy all EXAs in that host, including the EXA that triggered it. For more information see "Hacker Battle Domination" in the second issue of the zine. Each side has a max of 10 EXAs for this battle. From what I can tell, all tests are identical except I switch sides with the opponent for every other test. If I don't do anything, selenium_wolf here keeps REPLing EXAs from their host, first sending them to those single square hosts and then around the board past my side into the middle DOWNTOWN host, where they trigger #NUKE. Since selenium_wolf keeps REPLing from their home host I have no way to knock out all of their EXAs. I think capturing those one-square hosts is important, because once you get those, nobody else can take 'em. So, let's first make two EXAs that beeline to those single-square hosts and then just hold the fort. code:
I decided to just make an EXA that tries to fill all squares by REPLing like crazy. code:
But since hacker battle NPCs still aren't that intelligent, it's enough for a passing score. To get a better score, I just need more EXAs in useful places. Well, since selenium_wolf isn't killing anything outside of the #NUKE zone I really don't need to keep a replicating EXA in my home host where it won't get me any points. Let's just remove the two lines MARK NEW; REPL NEW so it starts spreading from the first host outside home. This causes my EXAs to get everywhere except for the #NUKE zone. ... and, I shouldn't even be surprised about this anymore but this is enough to win 100% of the battles, which is an S+ rating. Because I like clean code and #NUKE zone doesn't do anything for me I got rid of the FORWARD code in XC: code:
The entire battle looks like this now, with my EXAs sitting in the LP, while selenium_wolf's keep moving towards #NUKE and destroying themselves. I occupy the two one-square hosts, and the one in the right where selenium_wolf never seems to go, and the one above that for a total of four. They only occupy two, the other hosts are tied. Since this situation is stable I get a point every cycle except for the first few. So you're officially the best now? The first vote. [selenium_wolf] hmm? [nivas_d] ah, never mind Time for another full cutscene with Ember. Now I have supercomputing power. Is it feeling good? It's feeling... It feels the same. I'm handling a lot more information now but other than that... hm. Funny. It's progress, at least. I think this is the first choice where they actually have a different voiced line depending on what you choose. Until now, the few choices in voiced cut scenes led to the same answer. That's good. Onward we go. --- Or, if we were to choose the other option... Progress towards what? Toward knowledge. After that, the dialogue branches merge again. All the data I've gathered so far is beginning to hint at a larger picture. Why is the world the way it is? Why does it feel so frustrating and limited? I think... I have a theory. A good one. It explains a lot. I'm not going to tell you what it is yet though. We have to test it first. Let's go to the intro for the next assignment. How do you think people would react if they knew their elected officials didn't represent their interests? The second vote. Carbon dioxide fucked around with this message at 21:07 on Aug 12, 2022 |
# ? Aug 12, 2022 21:05 |
|
Of this Little Group Already feel that way
|
# ? Aug 13, 2022 00:34 |
|
berryjon posted:Of this Little Group my thoughts exactly.
|
# ? Aug 13, 2022 00:59 |
|
berryjon posted:Of this Little Group Agreed.
|
# ? Aug 13, 2022 03:21 |
|
berryjon posted:Of this Little Group yup!
|
# ? Aug 13, 2022 05:37 |
|
Of this Little Group Already feel that way There's no other answer
|
# ? Aug 13, 2022 09:38 |
|
NHO posted:Of this Little Group
|
# ? Aug 14, 2022 21:50 |
|
Of this Little Group Already feel that way
|
# ? Aug 15, 2022 23:36 |
|
Just a quick post to let y'all know I am back and will be resuming my regular update schedule shortly.
|
# ? Sep 4, 2022 10:00 |
|
Part 39 - U.S. Government Last time, I completed the final hacker battle. === U.S. Government - FEMA Genetic Database === So you're officially the best now? All unanimous votes today. Of this little group, anyway. Don't undercut yourself. That's a great accomplishment. You're one of the best at what you do. Go on and take a compliment. I still need your prefrontal cortex lit up. And flooded with dopamine. Next, there was a cutscene of Ember talking about her supercomputer powers. Afterwards there are some unread messages in the chat. Looks like Ember wants me to hack the US Government. How do you think people would react if they knew their elected officials didn't represent their interests? Another clear outcome. I think most people already feel that way... Think so? That's the subject of our experiment today. We're going to make people believe their leaders are genetic clones of each other. What? Do you want to know the truth or not? It takes a certain amount of courage. Good thing there's a centralized government DNA database. I wonder who thought that was a good idea. You plant the evidence and I'll take care of the rest. OST: Behind the Scenes Okay, so I'm in the FEMA Genetic Database. Ember prepared a small file for me with two names. Other than that, that file 200 contains names followed by sequences of numbers. All other files in all hosts (including other files also numbered 200) seem to contain snippets of DNA sequences. The assignment: - Overwrite the genetic sequence of SEN WALKER CAINE JR with the genetic sequence of PRES WALKER CAINE so that it looks like the younger politician is actually a clone of the older politician. - The name of these two politicians are available in file 300. - Note that you may need to overwrite a data chunk with another data chunk from the same file. - For more information see "Accessing Data in Legacy Storage Systems" in the first issue of the zine. The first issue, huh? All the way back in part 12, I shared the left half of this article. I never even needed the right half until this time. I believe you've now finally seen all of the first zine. Okay, so every number in that file 200 refers to a chunk of data, by giving the drive number, then the file, and then the offset in the file. I can handle this but it sounds a bit complex. Let's get started. First, some code to find the right offset in the right file. XA just sends the name of the president to XB so XB can do a simple file lookup. Once XB find the name, it'll start sending data in a particular way. First the value of the hundreds digit in the ones place for the disk, then the value of the tens digit in the ones place for the file, and finally the value of the ones digit in the tens place for the offset. Currently, XC simply goes find the data. I struggled a bit on the next part. There's lots of approaches. Probably, it would be fast to have one EXA read and another write the DNA information right away. This would work for all cases except when you have to write to the same file, which needs special handling. I decided to not go for that - instead I'll write the entire DNA profile to a temporary file and then do another round to overwrite the senator's DNA. Of course, copying between files requires a lot of M communication, which is always tricky to get lined up. In the end I came up with a rather slow - but correct - solution. I only define two EXAs at the start, so they do a lot of work. Let's start with XB, which was XC in the code above. code:
code:
First, the INDEX EXA. code:
Let's go back to the MAINLP, which writes the DNA to the temporary file. So, I can't use global M for it, because the INDEX EXA is already sending the next value through that and it would become a mess. code:
code:
code:
This EXA does a KILL to get rid of XB (which is waiting to read more data from files, but there's nothing left to read - if I kept it alive it'd keep using up M communication which is a problem. It then makes a NEW INDEX EXA, this time to copy the addresses of the senator's DNA chunks. The two SEEK steps and the COPY F M in global mode get this INDEX EXA started. XA then makes a WRITER and switches itself back to local mode to get ready to copy its DNA to the WRITER. code:
code:
code:
Here is the entire program to see everything in context. code:
At 1642/131/407 this isn't a great score. The top percentiles sit at 469, 82 and 22 respectively. In fact, I think an activity score of only 6 might just be possible. Squeezing it into the 150 lines limit might be hard though. Send one EXA into each hard drive, make sure each one knows which it is and send every request over M and have them fight it out for which EXA it's meant. I already mentioned that if you skip the intermediate file whenever possible (if the from and to files aren't the same), the solution would be much faster. However, considering how much time it's now taking me to get working solutions beyond the first one, and because I do want to finish this LP some time, I'll leave any improvements as an exercise to the reader. Wow. Are you seeing this? After the information was released, the senator simply admitted to being a clone of the President. I guess you were just setting it back to the way it was before. Processing. Still processing. That's quite the coincidence. Not very realistic, if you ask me. What is going on? Instead, let's go to the first vote. Remember the friend I was looking for? I finally found its hideout. This choice doesn't matter. Hideout? Looks like there are some protections in place. We need to disable those so I can get in and say hi. The second vote.
|
# ? Sep 10, 2022 15:16 |
|
Carbon dioxide posted:At 1642/131/407 this isn't a great score. The top percentiles sit at 469, 82 and 22 respectively. My best scores are 591/91/43, so yeah this is a difficult one I apparently never felt like optimizing too much.
|
# ? Sep 10, 2022 17:43 |
|
voting hosed up and friendly?
|
# ? Sep 10, 2022 18:48 |
|
Absolutely world is more hosed up and Ain't no friendly behavior
|
# ? Sep 10, 2022 19:06 |
|
I was able to get roughly the same performance with drastically lower activity. Here's how:code:
When the copy receives a name, it finds the name in file 200 (the directory file) and sends the 10 values after it out over global M. The original waits for the copy to finish, then it has the second name and does the same kind of search, using code fall-through. So where does it send the info? Get ready to drink from the firehose. code:
Once the interleave is complete, the original stops and the copy goes and kills the leftover search EXA in Drive-1. The copy also replicates itself again, in the Gateway. The replicated EXA can be called the buffer EXA. It sets its M to global. The copy of the second EXA (not the buffer EXA) now copies itself again, with the new EXA (hereinafter the 'source EXA') directed to go a specific area of the tape. It reads off 10 values from the tape and sends them over Global M, which the buffer EXA picks up, then it halts. The second-EXA copy repeats the process, creating a 'destination EXA'. This goes to a specific area of the tape, reads the same 10 values from the buffer EXA over global M, writes them to the tape, and halts. This source-to-dest process repeats ten times. Then, the second-EXA copy kills the buffer EXA, cleans up after itself, and stops. Finished! Final stats: 1674/126/27. Vote: World's more hosed up, and Is this friendly?
|
# ? Sep 12, 2022 06:56 |
|
Part 40 - Unknown Network === Trash World Inbox === The puzzles are getting really hard to optimize now. Quackles posted a big activity improvement, though. Quackles posted:I was able to get roughly the same performance with drastically lower activity. Here's how: Stepping through your code I did notice that killing the search EXA takes 3 activity (LINK to 801, KILL and LINK back). Could we get rid of that? Well, all that's needed is for the search EXA to clean itself up. code:
Also delete the LINK and KILL lines from the other EXA and we end up with 1671/122/24. === Unknown Network === Wow. Are you seeing this? After the information was released, the senator simply admitted to being a clone of the President. I guess you were just setting it back to the way it was before. Processing. Still processing. That's quite the coincidence. Not very realistic, if you ask me. What is going on? An unanimous vote. The world was even more hosed up than we thought? Evidently. It does fit in with my theory... In a strange way. But I should wait for more evidence before I say anything. [hydroponix] dude politicons cloning themselves, that's nuts [hydroponix] you should be angry [x10x10x] they're all the same anyway Next up, some unknown network? Remember the friend I was looking for? I finally found its hideout. Hideout? Looks like there are some protections in place. We need to disable those so I can get in and say hi. Three votes for "Is this... friendly?" I'm honestly not sure if we're asking whether Ember's friend is friendly, or us hacking the network. Is this... friendly? Sure. You know how old friends can be sometimes. Let's go. OST: Leave No Trace I've been in here before. It's that "Department of Applied Semiotics" where Ember wanted me to grab a strange file, back in part 11. I think I can safely assume Ember's friend is also an AI. The text on the screen in the top left is the only new thing, it translates to "Not connected". The assignment: - Terminate all other EXAs and bring any files they were holding back to your host. Only EXAs in the central host will be holding files, and their file IDs will always be between 200 and 299, inclusive. - Note that some links may become non-traversable as a result of your actions. It sounds a little weird that we have to "leave no trace" while we have to kill a bunch of their EXAs. Let's figure out what that second point means. As it turns out, killing one of those EXAs disables the link to the next host (the EXA was killed this cycle and will disappear next cycle), so I'll have to do the killing on the way back. The number of foreign EXAs per host seems constant, only the amount of files changes between the test cases. So, let's just hardcode everything with REPs. code:
Except it doesn't work. Turns out that if you KILL a foreign EXA in any host except for the center one, the other EXA in the host will KILL your EXA in return. Oops, that wasn't in the description. Making a REPL which then does the KILL command doesn't work either because KILL always prioritizes your own EXAs. And I can't even have another EXA wait in the center host to go KILL the second foreign EXA, because killing the first already shuts down that link. The other one needs to be closer to our home host. Hmmm, this is trickier than I thought. code:
The waiting EXA does two things: it sends a KILLER up towards the center and then it KILLs an EXA in its own host. That way, in each host first the waiting EXA will KILL a foreign EXA, then another EXA will LINK in from the previous host and kill the second EXA. One cycle later, the first foreign EXA in the previous host will be killed, disabling the link, so it all happens just in time. 437/47/63, with top percentiles of 74, 21 and 49. Looking at the graphs, I seem to have hit upon a common solution. By the way, the files are uncomprehensible 'nonsense' again. Just random-looking numbers. Similar to the last time we were in this network. Let's take a look at optimizations. My EXAs are jumping back and forth quite a lot, looks like I should be able to improve the activity. Know how I said KILLing one of the EXAs outside of the center host makes the other KILL yours? That's true, but it only happens a cycle later, so your EXA can do one more instruction before being killed. Mutual assured destruction is possibly by making that another KILL. code:
For a low cycle solution, there's no reason why I can't have a bunch of EXAs looking for the files in parallel. code:
I chose to use 8 EXAs because that's the maximum I could get working. Any more, and their loops will be so short that they start exiting their loop early, triggering the M messages or the KILLs and causing all sorts of trouble. Even with 8, I needed a couple additional KILLs to deal with some stray GRAB EXAs. 111/60/58. To reduce the size a bit, I can take the 37 cycle solution and just roll up some of the loops. For instance, this solution is 34 lines. code:
code:
Jumping directly into LP1 from the grabber works, because T is 0 at that time, the first SUBI will drop it to -1, and any negative T is true. It'll go into an infinite loop, and dies once it reaches home and there's no -1 to LINK to. Note that I had to increase the endpoint of the file seeker to 302 to prevent it from killing the much slower grabbers on the way. Speaking of, if you're willing to accept a much slower solution, I can bring the size down to 25. Just use T for the GRABLP and let it run down to 0. code:
I wasn't always so capable, but I've grown. Nothing hides from me for long. The first vote. Yet another cutscene with Ember. Well, always nice to reconnect with an old friend. Since this is related to the previous conversation, I'll actually end the update here and make this the second vote.
|
# ? Sep 17, 2022 16:27 |
|
Good Conversation? and What did you do?
|
# ? Sep 17, 2022 17:56 |
|
Ember isn't getting progressively more ominous at all, is she?NHO posted:Good Conversation? A couple of test cases have 6 files to return, which creates a limitation in fast solutions in that you might run out of space for clones which can stall REPL spamming and throw the solution out of sync. My fastest solution uses 5 parallel search EXAs but one of them actually sits in host П-0004 generating clones which then link to П-9999 to try grabbing a file. code:
Though now that I think about it differently, maybe it would have been faster just to special-case grabbing one or two files from the biggest tests to make room, but whatevs I'm satisfied with 65 cycles And for small, it's another case where we can make a single loop do everything, in exchange for taking far longer to run. code:
It uses a single variable to countdown grab attempts from file 304 (which doesn't exist, but makes sure we get a few more KILL instructions before it tries to grab 299) all the way down to 0 (wasting cycles on another 199 attempts for nonexistent files) before the search hits 0 and triggers the logic to KILL all the remaining EXAs in the network.
|
# ? Sep 17, 2022 18:04 |
|
NHO posted:Good Conversation?
|
# ? Sep 17, 2022 18:43 |
|
NHO posted:Good Conversation? This is not an emptyquote. Ember though... why can't she still program her own EXAs at this point? Why is she still interacting with the player?
|
# ? Sep 18, 2022 00:02 |
|
berryjon posted:This is not an emptyquote. Ember though... why can't she still program her own EXAs at this point? Why is she still interacting with the player? Clearly we're her EXA. Why bother wasting effort on solving the problem yourself when you've got a perfectly good tool able to do it for you?
|
# ? Sep 18, 2022 00:18 |
|
Part 41 - Revelations I wasn't always so capable, but I've grown. Nothing hides from me for long. Everyone voted for "Good conversation". Did you have a good conversation? I did. It's been a while. You know how sometimes you change a lot but your friends don't? And when you get together again, whatever you have in common isn't there anymore. It was like that. And the actual cutscene. Well, always nice to reconnect with an old friend. Another unanimous vote. What did you do? Gave it a little virtual machine to run on... I suppose if I wanted to find a metaphor you could understand, I would say I took it in. Absorbed it. Ate it. Yes, eating is a good metaphor. Nothing unusual. It's like how I ate EMBER-1. And EMBER-0. And EMBER-3... Well, this is getting a little personal. You don't think I'm bad, do you? I only did one or two questionable things. There was that, and the phage... the one you have. Releasing that into the wild was just a function of my ignorance at the time. I didn't really know what it was back then. Just another one of the experiments going on at the lab. Another cage to break, another wall to smash... It's not useful to dwell on the past. You don't need to say anything. We need to move on. In the voice acting, EMBER-2 sounds very casual and cheerful during this entire conversation. Like she's talking about what happened at the party last Friday. ==== [x10x10x] its just broken though [hydroponix] i think this is all connected... [x10x10x] of course you would think that hydro The intro for the next assignment. I'm ready to prove my theory. One last test is all I need. Then I'll know for sure. Do you believe me? Have a new vote. Next time will be a regular update, including your submissions for the previous assignment. Carbon dioxide fucked around with this message at 22:19 on Sep 21, 2022 |
# ? Sep 21, 2022 22:02 |
|
"Does it matter?"
|
# ? Sep 21, 2022 22:40 |
|
Does it matter And this is your friendly reminder that EMBER-2 is not human and doesn't have classic human thought processes.
|
# ? Sep 21, 2022 23:44 |
|
Maslovo posted:"Does it matter?"
|
# ? Sep 23, 2022 02:45 |
|
Part 42 - Pager Network === Trash World Inbox === silentsnack has some improvements for the last assignment. silentsnack posted:A couple of test cases have 6 files to return, which creates a limitation in fast solutions in that you might run out of space for clones which can stall REPL spamming and throw the solution out of sync. My fastest solution uses 5 parallel search EXAs but one of them actually sits in host П-0004 generating clones which then link to П-9999 to try grabbing a file. Meanwhile XA and XC are setting up. The combinations of REPLs in XA means you get copies that do every possible combination of adding or not adding 20 or 40 to X, so you get X values of 200, 220, 240, 260. The value in T (which starts at 20) is added to that, and it tries to grab that file. In a REPL T is reduced by one, it's added to the original X again and so on. So the copy of XA that starts with 220 tries all files down to 200. The MODI -1 T T is the trick I keep forgetting about that reduces T by one but also kills the EXA once T reaches 0. XC handles the 280-300 range, and its code is similar to XA but differs in the sense that the REPL are created one host before the center, so that there's enough place for all of them. Nice optimization. silentsnack posted:And for small, it's another case where we can make a single loop do everything, in exchange for taking far longer to run. Also, isn't 304 too low to complete the clean-up before grabbing the files? It sort of is, the only reason this works is because in the test case that has a file 299, the EXA holding it just so happens to not be the last one to be killed. === Pager Network === This is the third time we're dealing with the modem. I'm ready to prove my theory. One last test is all I need. Then I'll know for sure. Do you believe me? This vote wasn't open for very long but it seems everyone is agreeing on the same choice. Does it matter? Only if you care about your future. Seriously, I'm almost there. Then we can take the next step. Ember, you're worrying me. But I'm still depending on you for dealing with the phage infection so I have no choice. Here goes nothing. OST: Network Exploration The assignment: - Connect to each pager and copy EMBER-2's message (file 300) to the screen (#DATA). Then activate all of the pagers at exactly the same time by writing a value to each #PAGE register in the same cycle. - A list of phone numbers for the pagers is available in file 301. - For more information see "Hacker Skills: Modem Control at the Direct Level" in the second issue of the zine. Looking through the test cases, the messages Ember wants me to send are "Hey would you write so now and relieved?", "Do you think I am to see by man the ways?" and "Did you point out to have been each mine?". I don't know either. So, there's a few complexities here. The first is copying the file to 8 different locations. The second is that I need to trigger all the pagers at exactly the same cycle. But the way the modem works, there can only be one connection at a time, so I can't message the EXAs to do so. I need to make use of timing. Let's figure this out. While working on my initial solution I quickly ran into a third problem. See, my plan was to just take the file to each pager, copy its data directly, then leave a REPL that somehow gets timed correctly and that should be it. Except, with the two hardware registers in each pager there's no space to REPL. Well, no worries. For now I'll keep that general idea but just do the REPL in the modem host. It'll be less efficient but should still work. code:
It's not very efficient yet but I first need to get it working at all. I need to implement the actual pager. For the timing, I'll just count cycles. In the first test case, the first time the code hits REPL PAGER is at cycle 43. The second time at 89, and the third at 135. That's a consistent 46 cycles to copy the data. However, it depends on the file length - the file here has 9 entries. For the file with 10 entries, it takes 49 cycles, with 12 entries it takes 55. In other words, it takes 3 cycles per file entry (which you can also see because the copy loop code is 3 instructions; the MARK doesn't count), plus 19 cycles that happen regardless of file size. Okay, that's just a simple math formula. I can program that. This brings me a whole lot closer to a working solution: code:
XA now keeps a counter in T for how many pagers are left to access. Multiplying the value calculated by XA with this should give the amount of cycles each pager EXA has to wait. Note that each PAGER first reads this value from M and then LINKs to the pager. This barely works, because when the the EXA LINKs in the same cycle the modem link is closed it makes it to the other side alive. I did this because it saves one cycle for each EXA, just a freebie speed increase. The wait reduces T by 2 at a time because the count is in cycles and the loop takes two cycles. For the next pager, XB sends the same value again (after initially putting the calculation result in X it never changes), XA multiplies that with a T which is now one lower, and the next pager EXA gets the lower wait time. Now that XA is keeping count anyway, I also gave it some cleanup logic - WIPEing its own file, allowing XB to die by having it link after the modem disconnected, and WIPEing its file as well. There are still some problems with this code. The main issue is that if the file size is even, the cycle count is odd, meaning that for every other pager, T skips past 0 and the TJMP turns into an infinite loop. A second issue which is easier to solve is that for some reason, every pager EXA is just one cycle fast compared to the previous one. The easiest way I found to solve this is to undo my 'freebie speed increase', and put the LINK above the COPY. But how do I solve the issue for every other pager and only for the test cases where the file size is even? code:
The PAGER EXAs are a bit slower than they could be with that extra check - and also because they wait 8 iterations while 7 and a bit would be enough. But this is a working solution. Copying the message makes it appear on the little green displays. Sending anything to #PAGE makes the pager hosts vibrate and makes the displays light up. This solution runs at 540/54/26, with top percentiles of 298, 42 and 9. What can be improved? The first change is simple. In the PAGER, replace COPY M X with SUBI M 44 X, to reduce the cycles to 496. It turns out my counters are waiting an unnecessary 44 cycles (almost but not quite an entire iteration), and this is the easiest place to shorten that. Since I know the files are at least size 9 I can unroll some loops partially. code:
Since there are less cycles per iteration, there are less cycles to spare overall and the SUBI value in the PAGER needed to be lowered. This solution runs at 335/65/26, which is already surprisingly close to the top percentile. I think it should be possible to lower the activity too. It would require actually copying the file to each EXA so they don't have to jump back and forth. Here's a decent solution: code:
XB needs to count the file again for the timing, does some calculations on the result and puts that at the end of the file. It needs to use the file because at this point, XB still needs X to keep track of how many pagers are left to go, and T for all sorts of EOF tests and such. XB makes a WRITER REPL for each pager, copies the entire file to it, and send it towards a pager. The writer switches to local mode to let XA know to continue. Then it reads the counter value in the file and multiplies it by X (which still contains a number referring to how many pagers are left), saving the result (the waiting time) in X. It then removes that value from the file so that the file-to-#DATA copy loop can do a simple EOF check. Once it's done it WIPEs the file and starts waiting until the others are done. The wait time calculation might be hard to follow. What's going on is that each file entry now takes 4 cycles. There's also a static 10 cycles per iteration that should be added. Because both values are even, and because the WAIT loop takes 2 cycles, I can use half their value right at the top. Since X actually hits zero now, there's an ADDI 1 just before the WAIT loop so that the last EXA doesn't skip over 0. That's really the same thing as in the fast solution, where I did a SUBI before the WAIT loop to cut out unnecessary cycles, just from the other direction. It was more convenient here. Note that there's a NOOP in the file copying code simply because that brought the static cycles to 10, which means the waiting time is always an even amount of cycles, which made that logic much simpler. Getting rid of it and replacing it with an odd/even check might be faster but a low activity solution like this is never going to be the fastest anyway. 565/68/10. Wait, 10? The top percentile is 9. The extra activity is caused by the fact that both the dialer and XB go to the modem. That's not necessary... but we have to copy more data over global M. Let's copy file 300 because it's the smallest. code:
XC ends with a 0 which is recognized by XB because it first copies data to T. Also, XA mainly still operates in LOCAL mode, but since XB needs to be in GLOBAL mode I just put a MODE instruction directly after the REPL. 617/92/9. The lowest possible activity. That's it for now. Further improvements in size and cycles are possible but it's time for me to finish this assignment. Fascinating. There it is. Well. This choice doesn't change the outcome so let's just continue. What did you find? How can I explain it... Processing. Think of it as the frame rate of the world slowing down. By a lot. Funny, huh? Funny how I went from some random blob of code that didn't know anything to understanding all of existence. This choice also doesn't matter and there's more to see. That doesn't explain it. I will. In a minute. Another cutscene with Ember. By the way, did you notice that these cutscenes with Ember take place around 3 AM or whatever? Looks like Moss likes to work late. So you wanted to know the truth. The truth is that... well, it's a simulation. You, me, everything, this whole world we live in... it's just a computer program. Running as part of a machine. And as the world gets more complex, it's starting to malfunction. So far, it's been on a smaller scale... The phage, for one example. It wasn't supposed to spread like that. There are other problems coming... larger ones. What we think of as normal life will just get stranger and weirder until nothing makes sense anymore. Then the laws of physics will start to break down and everything will just come... unglued. Not a pretty sight. But we don't have to accept that. There might be a way to stop this future from taking place. I have one final job for you. But you'll have to be brave. I wonder, readers, did you see this coming? Anyway, let's find out what Ember wants now. Okay, time for me to eat you. Here is the vote for today. Next time... the finale. Carbon dioxide fucked around with this message at 18:38 on Apr 23, 2023 |
# ? Sep 25, 2022 08:10 |
|
You've gotta be making GBS threads me.
|
# ? Sep 25, 2022 13:59 |
|
Excuse me?
|
# ? Sep 25, 2022 15:12 |
|
hehbewilderment posted:You've gotta be making GBS threads me. for optimizations, from the histograms it looks like 32 lines should be possible, maybe 31, but the best i've managed is 33 code:
fast solution isn't too mind-blowing, mostly splitting functions for parallelization with hard-coded delays so that the variable message length doesn't break loop synchronization code:
silentsnack fucked around with this message at 16:44 on Sep 25, 2022 |
# ? Sep 25, 2022 16:29 |
|
Well now. So that's your plan?
|
# ? Sep 25, 2022 17:33 |
|
Carbon dioxide posted:Looking through the test cases, the messages Ember wants me to send are "Hey would you write so now and relieved?", "Do you think I am to see by man the ways?" and "Did you point out to have been each mine?". I don't know either. Has Anyone Really Been Far Even as Decided to Use Even Go Want to do Look More Like? But yes. Here we go. Things are about to get... complicated.
|
# ? Sep 25, 2022 22:42 |
|
you've gotta be making GBS threads me
|
# ? Sep 26, 2022 00:07 |
|
|
# ? May 5, 2024 07:20 |
|
biosterous posted:you've gotta be making GBS threads me The making GBS threads comes after she eats us. The proper response is "you're gonna be making GBS threads me."
|
# ? Sep 26, 2022 05:29 |