« first day (863 days earlier)      last day (4102 days later) » 

2:00 AM
@user1929959 Grow something resembling testicles or a vagina worth having and wrap up the FFMPeg API in objects if you desperately want object orientation.
 
@user1929959 You're right, the API is in C.
 
if (onlyWriteToCache)
    {
        buffer[index] = (char)(index % 255);
    }
    else
    {
        buffer[index] = (char)(buffer[index] % 255);
    }
@AndyProwl Is that your test case for #3?
 
si...I just read about it, some of that is obsolete
 
@Mysticial Yes, that should be it, and it behaves differently from how I would expect
 
2:02 AM
@AndyProwl What type is buffer?
 
@Rapptz Lies.
 
@user1929959 Some is obsolete and is marked as such. Did you try github.com/mpenkov/ffmpeg-tutorial ?
 
@Mysticial It's an array of chars
char* buffer = new char[BUFFER_SIZE];
 
@AndyProwl haha..............
 
@Mysticial Did you spot something?
 
2:04 AM
Here's a hint: How do you think the compiler is gonna optimize the % 255 if the input is a char?
 
@Rapptz What was wrong with that approach, exactly?
 
yap...is very simple example, but insufficient
using SDL for make some video player :)))
 
@Mysticial I'm very bad at this :D Like, it's going to do a bitwise & with FF?
 
it put it in the corner.
 
@Rapptz Okay... Just, push everything you have, and I'll pull.
 
2:05 AM
so...OpenCV is the alternative?
 
If I can implement it with what I'm talking about, I'm going to slap you with a turkey.
 
I just read about transcoding with it...is possible
 
A wet, slightly frozen turkey.
 
@AndyProwl Not quite. Since the input is bound by 0-255 (ignore the signness for now), and your modding by 255, it's almost always gonna return the same number except when the input is 255.
 
Just so we're clear, I know how to make it click and drag with the whole "it'll drag it through the corner" thing
that's relatively simple
 
2:06 AM
So the compiler is probably smart enough to replace the %255 with an if-statement test.
Check the assembly to see if I'm right.
 
user142019
 
But when you do index % 255, the input is potentially large. So the compiler must do something more complicated - or just emit an actual division.
 
@Mysticial Wait a sec, you mean (index % 255)? But index is not a char
index is an int
 
@AndyProwl In the read-write case.
You do buffer[index] % 255
 
@Zoidberg I don't want to talk to my glasses to do shit..that's just...bleh
 
user142019
2:08 AM
Isn't % 255 on a char very silly?
 
^^
 
@Mysticial That's embarassing
:D
 
Check the assembly to see if I'm correct.
 
@Mysticial I think there's not even the need to check, but I will
 
Well, it's not obvious at all actually.
I had to ask you what type buffer was...
 
user142019
2:09 AM
How did you learn all those things about optimizations?
 
And that's only because I suspected it was a char to begin with.
 
@Mysticial That was smart
 
@Zoidberg The hard way... :P
 
user142019
lol
 
so...OpenCV can be view as an alternative for ffmpeg?
?
 
2:17 AM
@Mysticial It does as you say
Thank you for the hint
 
:D
 
Xeo
@Zoidberg You're asking the guy who got the record on the most digits of Pi how he knows about optimizations? Sometimes, I'm wondering if you're even trying.
 
user142019
No.
 
user142019
I asked how he learned it.
 
@AndyProwl Try replacing the % 255 with something like + 123. You'll probably find that the performance difference will be much smaller.
 
2:22 AM
@Mysticial I'm going to try that yes
 
If that confirms it, I'll post an answer summarizing this and link back to this chat transcript.
 
Xeo
Note: Mozzarella doesn't make for a good cheese to gratinate stuff with in the microwave.
 
But yeah, that wasn't an easy question. You'd expect the answer to be a misunderstanding of the caches when really the test was subtlely broken due to compiler optimizations.
 
@Mysticial Sure. I just need to solve some dll not found problems that popped up when starting the exe from command line
@Mysticial Yet it took you 5 minutes to solve it :-) I'd better not tell how many pages of stuff I've tried to read without understanding in the hope of figuring out why it behaved this way
 
Xeo
@Mysticial Wait, if it's a buffer of char, how is the range 0-255?
Normally, plain char is signed.
 
2:24 AM
@Xeo I mentioned "ignore the signness for now".
 
Xeo
Ah
 
It doesn't take much to transform it so that it works.
@Xeo lol, when it's signed, it just returns the same number.
-1 % 255 -> -1
-128 % 255 -> -128
127 % 255 -> 127
No if-statement needed.
 
So why % 255 in the first place?
 
@ThePhD I don't think Andy was aware of this to begin with.
 
Mmm.
 
2:29 AM
I wasn't either, until I booted up the compiler to see the behavior for negative input to %.
 
But I mean, in general.
Why % 255 on a char ?
 
He probably didn't realize it.
 
Ah.
 
It's just an artificial benchmark to test something.
So it's easy to overlook these things.
Speaking of learning things the "hard way". Wanna guess at how I learned about denormal floats?
 
@Mysticial Indeed, I wasn't aware of this
@ThePhD It was a mistake
 
2:32 AM
Mmmkay.
 
@ScottW well... yes...
 
Also, my up-to-down for this seems weird...
... Ah well.
Shader (Derives from ShaderTechnique, contains ShaderTechniques) -> ShaderTechnique,
ShaderPass (contains ShaderMethods)
That seems like a good framework.
 
I was benchmarking some floating-point code. And I noticed that it would randomly slow down by a factor of a few hundred randomly. But when I ran it on actual data, it would always be fast.
After tinkering around it a bit, I realized that the slow downs only occur when the input is uninitialized.
 
Dat lazy initialization.
 
Xeo
Isn't reading from uninitialized input UB?
 
2:34 AM
Why the fluff is my video not working on iOS?!
 
Xeo
Or did you just write to it?
 
@Xeo That didn't matter. I was just trying to benchmark the speed of the code.
 
I have absolutely no idea now. The video is perfect; it works on other vid hosting sites.
 
Xeo
@Mysticial Erm, how can you correctly benchmark UB?
 
@Xeo In that case, UB is not likely to affect the results since it just runs arithmetic on data.
I wasn't trying to deference an uninitialized pointer.
It was just read stuff from memory, do arithmetic, write it back.
That's not the kind of stuff that's likely to invoke UB.
Not that I knew what UB was at the time anyways.
 
Xeo
2:37 AM
Yeah, but with UB, the compiler is allowed to assume all kinds of things, isn't it?
 
@Xeo Not when you know how compiler work.
 
Xeo
@Mysticial Reading from uninitialized data itself invokes UB
 
Xeo
@Mysticial True enough.
 
If you know how the compiler works and how it does things, you can immediately rule out many forms of UB.
And when I get it wrong, you get bullshit like my top question.
 
Xeo
2:38 AM
heh
 
Turns out that uninitialized data has a high chance of being denormalized. That's because stuff like a small integer, when reinterpreted as a float is denomalized. And uninitialized data is very likely to have old integer data on it.
 
@CatPlusPlus Got a moment?
Ah, wait he's not here.
Ah well, I'll puzzle this one over myself.
 
Xeo
Maybe we can help?
Or is it about your engine stuff?
 
I shouldn't be here but for some reason I'm watching LPs
 
Xeo
lawl
 
2:39 AM
It's more of a conceptual kind of deal.
I'm trying to figure out A) the best ownership pattern for shader methods and resources and B) how to best represent the Shader / ShaderTechnique / ShaderPass hierarchy without having to do virtual destructors and base interfacing.
It might take a while to explain. @__@
 
I got dragging to work decently.
 
@Rapptz You never pushed and let me try. :c
 
Sorry I didn't push, someone had a medical emergency lol
 
Oh.
Well nevermind then.
 
Xeo
@ScottW Or not so much
 
2:42 AM
oops wrong class.
 
Lulz.
 
@Rapptz Toooold you all you had to do was measure deltas.
And there's some correction for rect.left, whatever that is, but there you have it. :D
 
yeah I did deltas but I didn't correct for rect.left
rect.left is x, rect.top is y for the object
 
@CatPlusPlus If you like horror, you should watch Master of Audio Surf's Let's Plays and Day[9]'s Let's Plays of Amnesia.
 
@Mysticial: Results are indeed different now, but I am unsure how to interpret them. Maybe I'm tired or maybe I'm ignorant. Or both :) Will call it a night and think about it tomorrow
Thank you for your help anyway, much appreciated
 
np
I'm actually gonna be out of town until Thursday.
 
More interviews? :O
 
So I don't be able to post anything until Wednesday night, unless I happen to get internet at the hotels.
@ThePhD Conference this time.
Flying out to Boston tomorrow.
 
OOH
I LIVE IN BOSTON
If I stalk you hard enough I could touch your robe.
 
2:53 AM
lol
 
And some of your ycruncher genius may rub off on me.
 
I'm going to the SIAM conference.
So you might run into me if you go there. :)
 
Oh god that looks horrific to me.
 
@Mysticial Ok, I'll let you know when I'll meet you here again. Have a nice journey :-)
 
Nvm gl hf.
 
2:53 AM
And g'nite to everybody else
 
night
 
night
 
oh whoa it's only 10 PM
 
Sleep tight.
 
I thought it was like 3 AM
 
2:54 AM
Lol.
 
@Rapptz lol
 
Thought you'd be at it for longer than you were? :P
 
yes
:(
 
Xeo
It's 4am for me.
 
lol
 
2:56 AM
@ThePhD I can't get the positioning of the close button right though
 
@Rapptz TRY HARDER. D:<
I think I need to used shared_ptr.
 
user1357851
1:56pm here ^_^
 
Anything anyone should caution me about before I dip my toes into this one?
 
what's wrong with shared_ptr?
 
Xeo
@Mysticial Atleast I don't have work today.
 
2:57 AM
Just wondering. I've always been using unique_ptr for the most part.
 
they're different
 
I know internally shared_ptr uses... ref counting?
 
Xeo
One owner -> unique_ptr
 
you're supposed to use shared_ptr if you want the resource to be shared
 
Xeo
Multiple owners -> shared_ptr
 
2:58 AM
Hm.
shared_ptr it is.
No harm in a littel ref counting I guess.
 
Xeo
@Rapptz If you want those that share the resource to also own it, is the important point.
 
singleton
 
Xeo
If they don't need to own it, a normal pointer / reference is fine.
 
Well, the thing is my base class's sharing semantics are...
... optional.
 
Xeo
That sounds like highly bad design
 
2:59 AM
Pretty much...
 

« first day (863 days earlier)      last day (4102 days later) »