ais523 - high effort answers

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
Oct 1, 2023 23:35
by the way, I'm pretty sure self-replicating programs do exist in Trianguish, for much the same reason that TC languages generally have quines, but they'd almost certainly be too large to run in the JS interpreter
Oct 1, 2023 23:29
@Adám believe it or not this is actually a Jelly builtin. although I needed to add a second builtin to get the output format to match
Oct 1, 2023 23:27
so it was only about 3 days' worth of work rather than the weeks it looked like it coudl take
Oct 1, 2023 23:26
but the secondary constructors are easier to build than I anticipated because you don't have to build the logic that determines whta to build, you can just leave that in its original location and send the instructions along a wire
Oct 1, 2023 23:26
it is fun to watch, though, using builder snakes to reach points to build things, and building secondary constructors to avoid a slowdown
Oct 1, 2023 23:25
tbf this construction probably isn't worth all 2500 – you could just award 500 on my most recent (on this account)
Oct 1, 2023 22:20
ah, but you aren't, looks like I didn't quite get online in time
Oct 1, 2023 22:19
@RydwolfPrograms: if you want to talk about Trianguish, I'm here
Oct 1, 2023 02:25
and other compressed constants
Oct 1, 2023 02:24
vyncode should ideally detect compressed strings and send them literally, rather than attempting to vyncode them
Oct 1, 2023 02:19
now I'm wondering if this is technically a compression algorithm, we call it "compression" but it is different in nature from something like gzip
Oct 1, 2023 02:19
this is unless the length of the output is implied by the length of the input, in which case obviously it doesn't get any shorter because the particularly-compressed encodings are all being used for shorter strings
Oct 1, 2023 02:18
get two leading zeros and you save two bytes, and so on
Oct 1, 2023 02:17
get a leading zero after compression and you save a byte
Oct 1, 2023 02:17
err, 254/255
Oct 1, 2023 02:17
yes, that'll happen 255/256 of the time
Oct 1, 2023 02:16
(in practice, most compression methods do waste encodings on things like headers and checksums. but generally have variants which don't)
Oct 1, 2023 02:16
even if the compression method isn't random, we're assuming that pi is, so the probability of hitting an particularly compressible sequence doesn't depend on which sequences it is that are particularly compressible
Oct 1, 2023 02:15
any, assuming that the compression method doesn't waste encodings
Oct 1, 2023 02:13
so about 36 bytes
Oct 1, 2023 02:12
err, not bytes, decimal digits
Oct 1, 2023 02:12
good luck finding it, though :-D
Oct 1, 2023 02:11
assuming that pi is random, statistically the most-compressible 100-digit substring of the first 10^14 digits of pi probably compresses to 86 or 87 bytes
Oct 1, 2023 02:02
which seems potentially quite usable in a problem like this, so it would be good to know whether or not it's allowed
Oct 1, 2023 02:01
I think at least one language has a builtin for 2π
Oct 1, 2023 01:52
but those aren't validity / improvement complaints, more an issue with the concept
Oct 1, 2023 01:52
and the former seems incredibly tedious, it's basically the codegolf equivalent of bitcoin mining
Oct 1, 2023 01:51
I'm not sure if it's so interesting for the answerers, the theoretically optimal strategy is probably either "brute-force digits of pi until you find a particularly compressible string" or just calculating pi from the start
Oct 1, 2023 00:28
also that link is broken, I meant nethack4.org/pastebin/… (for the improvements patch)
Oct 1, 2023 00:23
also I made a few changes to my local copy of the Trianguish interpreter in order to make it a bit more usable when working with larger programs: nethack4.org/pastebin/…; I don't know whether you'd be interested in them or not
Oct 1, 2023 00:17
unfortunately a full construction is a) so large and b) so slow that I haven't been able to build a full program, but there's a working demonstration of the only non-obvious piece, everything else is straightforward
Oct 1, 2023 00:16
@RydwolfPrograms Is this valid to claim your bounty? esolangs.org/wiki/Trianguish#Computational_class
8
Oct 27, 2021 20:46
(and sandsifter apparently found one in 2017, but it was kept secret for fear it might be used maliciously – I wonder if it's been fixed yet, and when it'll become public)
Oct 27, 2021 20:43
although it was possible to fix that one in software via doing really weird things with the interrupt table
Oct 27, 2021 20:43
the more famous one is 0xf0 0x0f 0xc7 0xc8, which was also a hard lock on the processor
Oct 27, 2021 20:40
I'm vaguely tempted to try running it on my processor to see what happens (although I expect it'd just immediately SIGILL)
Oct 27, 2021 20:39
huh, after looking up encodings for the halt-and-catch-fire instruction (defined as anything that requires at least a power cycle to get the processor back to working order), it seems that 0x0f 0x04 did that on the 286, and the opcode in question is still unused on Intel processors even nowadays
Oct 27, 2021 19:51
so they have some incentive to be accurate
Oct 27, 2021 19:51
although, the reason they provide these things is to allow programmers to figure out what their program is bottlenecked on at the machine-code/microcode level, thus allowing them to work around the flaws of the processor and thus produce better benchmark results
Oct 27, 2021 19:50
quite possibly :-D
Oct 27, 2021 19:49
but it's frustrating, because you can only check things that the processor manufacturer thought to measure, and often you have to rely on measurements that don't measure exactly what you want
Oct 27, 2021 19:48
and learn, e.g., how many CPU cycles your program ran for, or how many memory accesses they made, or how many commands ran on execution port 6, etc.
Oct 27, 2021 19:48
modern processors have a range of performance counters that just count various things happening internally, you can monitor up to four of them at a time
Oct 27, 2021 19:48
there's also the perf command (Linux-specific, there's probably a Windows equivalent) which lets you see what the processor is doing via collecting statistics on various parts of the internals, it can be a lot of fun
Oct 27, 2021 19:47
not 100% accurate but pretty close
Oct 27, 2021 19:47
it's reverse-engineered internal details for most x86ish processors
Oct 27, 2021 19:46
Agner Fog's optimisation guide is pretty good if you're looking for a single thing to read, though
Oct 27, 2021 19:46
but, most of this isn't secret, you can find it with a web search once you've figured out the right questions to ask
Oct 27, 2021 19:46
actually I think I vaguely knew about the kernel zero page beforehand
Oct 27, 2021 19:45
I learned them writing the FizzBuzz program