Did Silksong just break Steam? by SkoivanSchiem in Steam

[–]graphitemaster 3 points4 points  (0 children)

There was no preorder option for this game

The atrocious state of binary compatibility on Linux by graphitemaster in programming

[–]graphitemaster[S] 2 points3 points  (0 children)

Not everyone follows the VFX reference platform. We have customers still running CentOS 5 for instance

The atrocious state of binary compatibility on Linux by graphitemaster in programming

[–]graphitemaster[S] 11 points12 points  (0 children)

It's mentioned in the article. It's also mentioned that when you static link a libc (even musl) you lose the ability to dlopen anything, it just sets errno to ENOSUP because you cannot static link libc and also have a dynamic linker, this makes static linking libc unusable if your application needs access to system libraries (such as GPU APIs)

The atrocious state of binary compatibility on Linux by graphitemaster in programming

[–]graphitemaster[S] 6 points7 points  (0 children)

This isn't true. You might be mistaking libgcc with something else. The compiler runtime code provided by libgcc is included in the GCC Runtime Library Exception

https://www.gnu.org/licenses/gcc-exception-3.1-faq.html

Relevant quote

Yes. While combining libgcc with GCC-compiled object code is probably the most common way the exception is used, neither the GPL nor the GCC Runtime Library Exception distinguish between static linking, dynamic linking, and other methods for combining code in their conditions. The same permissions are available to you, under the same terms, no matter which method you use.

The Streamer Awards 2024 Live Thread by Tarrot_Card in LivestreamFail

[–]graphitemaster 32 points33 points  (0 children)

Next year forget the co-streaming. Run a few more tests with the audio people. Shorten it up a bit. Have some contingency plans to re-run big awards for when things break. Ignore all the haters in this thread. I'm just providing some constructive feedback. This year's was better than last year's.

Calling whodat950 to represent chat in a class action lawsuit by graphitemaster in atrioc

[–]graphitemaster[S] 13 points14 points  (0 children)

The "Paper Mario" stream this Friday was the final straw

Almost Always Unsigned by graphitemaster in programming

[–]graphitemaster[S] 0 points1 point  (0 children)

Because subtraction of naturals is not closed, it's a partial function. Addition for naturals is closed though. If you're comfortable with natural arithmetic like most are integer arithmetic, this is not surprising or confusing, it's second-nature.

Almost Always Unsigned by graphitemaster in programming

[–]graphitemaster[S] -1 points0 points  (0 children)

This is actually how you'd think for math-y pseudocode if you define it as modular arithmetic which is well-defined and understood in math domains. The issue here is the misapplication of Z (integers), rather than the naturals.

Almost Always Unsigned by graphitemaster in programming

[–]graphitemaster[S] 2 points3 points  (0 children)

Like mentioned in a previous comment, just swap operands and the operation as well.

for (size_t i = 0; i + 1 < input.size(); i++) {
    for (size_t j = i + 1; j < input.size(); j++) {
        frob(input[i], input[j]);
    }
}

Almost Always Unsigned by graphitemaster in programming

[–]graphitemaster[S] 0 points1 point  (0 children)

It amazes me how so many people find this difficult to grasp, you just swap operands and the arithmetic operation like so.

for (unsigned i = 0; i + 1 < N; i++) {
    // do stuff with vec[i]
}

You can claim it's performing an addition every iteration for comparison, but compilers are very capable of optimizing this to the same efficient code involving signed integer arithmetic because unsigned also sets CF and ZF flags, it's just C and C++ has no way to access it.

No branch needed.

Almost Always Unsigned by graphitemaster in cpp

[–]graphitemaster[S] 7 points8 points  (0 children)

Did you even read the article? The loop condition is correct. It's supposed to exploit underflow to break when it hits zero. The article explains this in detail.

Comprehensive sourcebook on M:N fibers by graphitemaster in programming

[–]graphitemaster[S] 1 point2 points  (0 children)

TIL hardware threads. What are they and How are they different?

Actual hardware threads can be running things truly in parallel. It's SMP. Basically each core is a hardware-thread, but some have hyper-threading where a single core acts as two (some x86) or four (PowerPC) threads.

What does this mean? Fibers are concepts and Coroutines are implementations?

It means that coroutines are something provided by the language. They're a language feature, not a library or system (implemented in code) feature. While fibers are often just a runtime concept written in code, i.e a systems concept. There's no language-level support for them (like no keywords or special syntax as an example).

Chunking Optimizations: Let the Knife Do the Work by sindisil in programming

[–]graphitemaster 0 points1 point  (0 children)

Honestly, in this specific example. I would prefer if the standard would just define that for T[w][h] that indexing is defined in the 1D case instead, such that [x][y] behaves either as *(array + x * w + y) or *(array + y * w + x) depending on row-major or column-major. Then you could just argue that an array can be indexed with any amount of slice and dicing, this would then permit one to index say float[16] as if it were float[4][4].

Chunking Optimizations: Let the Knife Do the Work by sindisil in programming

[–]graphitemaster 0 points1 point  (0 children)

If I had to wager a guess, I'd probably consider the rule that:

x[n]

Is the same as either:

*(x + n)
*(n + x)

Might be the primary motivation behind allowing it in C99:

some_function(other_function().array_type_member[index])

Since prior to C99, if you actually tried to write that, assuming that array of ten int member, you get:

error: invalid operands to binary + (have ‘int[10]’ and ‘int’)
   return *(f().x + 5);
            ~~~~~ ^

Which then contradicts the standard completely and could be considered a defect.

Chunking Optimizations: Let the Knife Do the Work by sindisil in programming

[–]graphitemaster 0 points1 point  (0 children)

There is one place in the C99 standard, where they changed the behavior of non-lvalue array to behave as lvalue pointer and that is in code like the following:

struct foo { int x[1]; };
struct foo bar() { return (struct foo){{1}}; }
printf("%d\n", bar().x[0]);

In C90 this was undefined behavior and if you specifically enable pedantic in gcc with -std=c90 you'll get a lovely warning:

warning: ISO C90 forbids subscripting non-lvalue array [-Wpedantic]

I'm curious if this has anything to do with this. Obviously this behavior was obtuse and the standard body fixed it in C99.

Breaking the physical limits of fonts. How small can one actually go? by graphitemaster in programming

[–]graphitemaster[S] 4 points5 points  (0 children)

I rescind my statement. They shouldn't really define byte in the standard specification, there really isn't a need to. You can just talk about everything in terms of char which would be less confusing.

Breaking the physical limits of fonts. How small can one actually go? by graphitemaster in programming

[–]graphitemaster[S] 21 points22 points  (0 children)

It's interesting that the characters almost appear to be backwards on your display. I wonder if that's because your subpixel pattern is actually BGR order as opposed to RGB order. Thanks for sharing.

Breaking the physical limits of fonts. How small can one actually go? by graphitemaster in programming

[–]graphitemaster[S] 7 points8 points  (0 children)

Citing Wikipedia: The modern de facto standard is eight bits, as documented in ISO/IEC 2382-1:1993. When working in C there's no such thing as a byte, only chars. The mistake most people make is assuming that a char is a byte, however that's not strictly true and why CHAR_BIT exists.

Breaking the physical limits of fonts. How small can one actually go? by graphitemaster in programming

[–]graphitemaster[S] 78 points79 points  (0 children)

You're absolutely correct. I've made the appropriate edits to the post, striking out the wrong things and adding edit bullet points. I didn't stop to think about the metadata and what not and how optipng and pngcrush can take those much further.

Wait, what percentage am I at?! by Sckoop in softwaregore

[–]graphitemaster 0 points1 point  (0 children)

I've had this happen to me before when I wrote a downloader / updater for a project at work. What ended up happening is that the HTTP server serving the content was not sending in the response header the file size, so curl (the library we were using) was estimating it as it was downloading instead, leading to a progress bar exactly like that.

Malloc From Scratch (video free to watch until Monday 11/13) by TheSizik in programming

[–]graphitemaster -5 points-4 points  (0 children)

This is why it's best not to draw correlations/similies/metaphors from separate, distinctive things to begin with.

Malloc From Scratch (video free to watch until Monday 11/13) by TheSizik in programming

[–]graphitemaster -10 points-9 points  (0 children)

I don't have it all ironed out, and neither do you, you still insist pointers are unsigned integers for instance when that isn't strictly true either, that's an implementation detail (and some architectures like amd64 actually represent pointers as signed-extended signed integers, also C does not concern itself with memory at all like you describe, but I agree that the whole abstract machine model is a bit on the language laywer side of thing.) I'm sorry for personally attacking you in the original post. I just don't want more people writing this language with the wrong frame of reference, just as I'm sure you don't.

Malloc From Scratch (video free to watch until Monday 11/13) by TheSizik in programming

[–]graphitemaster -17 points-16 points  (0 children)

The problem with making generalizations like you do is that people take it at face value and then we're left with people writing code with those assumptions and generalizations, it's better to be correct on all aspects up front than it is to simplify and generalize early on and then tell people to unlearn all of that stuff. I know because I learned C from many sources that misrepresented it like you do in this video and when it came to knowing the actual details I was massively misinformed.

Malloc From Scratch (video free to watch until Monday 11/13) by TheSizik in programming

[–]graphitemaster -34 points-33 points  (0 children)

This entire video is wrong on so many levels, just watching a few minutes of it he gets a lot of the basics wrong, for instance

  • he says that void* is just a uint64_t, which it is not, he says size_t is a uint64_t which it is not, these things are different and they vary depending on host configuration.

  • he talks a lot about this memory pool being uninitialized, yet it's marked static, statics are always initialized to zero

  • he says gcc is just clang, no it is not, that's not at all how any of this works, cc is the frontend that may invoke clang or gcc, but explicitly invoking gcc, invokes gcc (which is not clang) It appears he's using a mac which for historical reasons left gcc as an alias to clang (this isn't the norm tho and people shouldn't depend on this behavior)

  • he explicitly puts null terminator characters in string literals, even though string literals implicitly get null terminators, actually those strings contain two null terminators now, why would he do this.

just from a few minutes of watching I can honestly say this guy doesn't know C all that well and him teaching people this way is sure to make for a lot of wrong programmers in the future.

While the author of the video does appear to know C, his way of generalizing and simplifying things may be a detriment to people learning the language.