« first day (3044 days earlier)      last day (1889 days later) » 

2:04 AM
I wonder ... if someone's ability can be measured by the number of variables a person can see in a particular situation. For example, a dumb and ignorant person might only able to see one variable, thus getting things wrong most of the times. A dumb but slightly experienced person or person without much experience but of average intelligence might see 2-3 variables and able to get things right 50%-60% of the times.
A highly intelligent person with great knowledge will get things right 90+% of the times. While as genius with expert knowledge will be able to accurately predict the outcome 99+% of the times and able to see a few steps ahead.
 
2:21 AM
Thus a dumb uneducated person is more liable to be brainwashed. It would take a lot more trying to convince an intelligent, well learned individual who have seen many things through travel and reading.
 
3:04 AM
The Andromeda–Milky Way collision is a galactic collision predicted to occur in about 3.75 billion years between two galaxies in the Local Group—the Milky Way (which contains the Solar System and Earth) and the Andromeda Galaxy. The stars involved are sufficiently far apart that it is improbable that any of them will individually collide. Some stars will be ejected from the resulting galaxy, nicknamed Milkomeda or Milkdromeda. == Certainty == The Andromeda Galaxy is approaching the Milky Way at about 110 kilometres per second (68 mi/s) as indicated by blueshift. However, the lateral velocity is...
I can't be the only one who does not this ...
Now the good news:
As a tolerant person, it's okay to be bigger than me ... as long as you are a vegetable!
 
 
2 hours later…
@Mikhail That's offensive. We need some porn to cleanse our minds after that.
 
This video has made me angrier than anything I've seen in a very long time
On one hand I understand why its evidence in a trial, on the other hand imagine a world where they could say “I love titration, and that's not a problem!"
 
If I can't do real porn, maybe at least some food porn...
 
@Mikhail Let's be more honest. It's mostly just "I'm so greedy, I'm happy to ruin people's lives, as long as it makes me more money."
 
4:50 AM
But its somehow so normalized that they didn't even try to hide it
 
@Mikhail Well, it's certainly true they're not even close to being the only ones.
But, I have to go pick up my son. Be back later, most likely.
 
 
2 hours later…
6:48 AM
@JerryCoffin The truth is that, people tend to sell their happiness and freedom for short way too often then they realise. If you have that kind of attitude, you are mostly likely having to surround people as shit as you in order to achieve a filthy level of wealth. There is a good chance your life is going to be miserable.
If you want to be happy, the trick is to cut things or people who make you unhappy out of your life. This trick works perfectly well for me, but then again, I am fiercely independent.
Also your taste in ... err ... 'art', is as good as this. But in a different way ...
 
7:20 AM
Go, Trump go! Trump has been my main source of entertainment for 2018.
 
 
2 hours later…
9:14 AM
@TelKitty Well, if only this happened sooner.
 
9:43 AM
`glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzle_mask);`
^ Cries in OGL
 
9:55 AM
@Mikhail You fail at Markdown.
 
I got one more unit to pass and then I can a can go to sleep, to wake up and shit post in this chat about how unit tests are bad
 
 
2 hours later…
11:42 AM
God I hate these hipster blogs
There's one about Cpp vs C# and the author actually says : "Compiler warnings: C++ will let you do almost anything provided the syntax is right. It’s a flexible language, but you can cause some real damage to the operating system."
You can cause some real damage to the OS, what is that even supposed to mean
 
@SombreroChicken It means you can brick your computer or worse
 
12:06 PM
@thecoshman You know if you made your own form you could just make it so people have to log in with their Stack Overflow account to submit the form.
 
12:29 PM
Why is it sooooo complicated to get a decent flight to London when the UK is literally the closest country from where I live
I need to wake up at 6am, go to Paris, wait for 6 fucking hours there before I get a flight to Heathrow and then I can finally take a try or something to get to London 1 hour later
There is an equivalent flight a 7am except I only have to wait 5 hours instead of 6, but also to change airports in Paris because why fucking not
In the meantime England is so close that when I try to find people on OkCupid I get results in Plymouth
It's really frustrating
In the meantime my airport has direct flights to Spain, Morocco and the Canary Islands, but not a single flight to England
whyyyyyyyyyyyyy
 
Brexit
 
@Morwenn take a train?
if you're going to go to paris anyway...
@Morwenn england isn't and never had been part of schengen free travel zone
 
12:47 PM
@Mgetz Trains from Brest aren't exactly faster or cheaper
 
@Morwenn might be easier though as you go through customs there
 
@Mgetz as far as I know neither is Morocco v0v
The airport is literally 5 minutes away from my house
 
@Morwenn yes... but brexit
 
Still, it's fucking dumb not to have direct flights to England
 
@Morwenn so is Brexit
 
12:48 PM
IIRC a cheap line to London was supposed to open later this year
Brest is overly dumb
 
Easy solution: Do not go to UK.
 
@JennaSloan I know what it's trying to convey but it's utter bullshit.
 
@wilx but I need to meet a girl friend :(
 
@JennaSloan except unless you're writing kernel code that's garbage
 
a girlfriend, oh boy
@Mgetz Exactly
 
12:54 PM
in two words, not one
 
Ill pay you in advance
 
> Introduce new tokens <<< and >>>
 
@Morwenn wut
 
1:09 PM
@Mgetz some random proposal in the Future Proposals forum
the proposed semantics were worse than the tokens x)
 
@Morwenn from the "Not The Problem We were trying to solve department"
 
yeah xD
We really needed to add more issues to iostreams
At least {fmt} should nicely solve the formatting part of the streams
 
IIRC the problem we were trying to solve is a better replacement all together for iostreams
 
1:24 PM
Now that's the kind of tech I like: news.mit.edu/2019/…
Turn your own company's waste into a product you had to buy from other sources
Reduce costs, reduce energy needed for shipping the materials, and dump less waste into the sea, which was also a costly operation
That's optimization at its finest ^^
 
1:35 PM
any quick solution to get over mental exhaustion hump?
 
find new and exiting projects to work on
 
^
 
1:56 PM
What does it mean when a company tries to interview you several times or is this normal.
 
@Rick normal
it means they're interested
 
nwp
If you do get the job consider taking it. If they are able to test you well it means there is a higher chance that your colleagues will be decent.
 
I just realized that I might be ignoring sanitizer errors because they don't always return non-zero exit codes when they find an error :x
Time to find even more bugs in my library, yay
 
@Morwenn That would seem to be a bug?
perhaps you should use AFL too
 
2:12 PM
@Mgetz How is it a bug?
 
@Morwenn generally if it's going to give an error it should fail yes?
 
@Mgetz by default ubsan only reports them as warnings and doesn't stop the execution
I hope that winafl isn't too hard to setup
 
@Morwenn ah
@Morwenn library doesn't build on linux?
 
2:33 PM
It does, but only on the CI, and my CI is already slow enough as is x)
My laptop uns Windows though
 
 
2 hours later…
4:59 PM
 
5:34 PM
so it looks like VS2019 is going to be a wasted release, because they are unwilling to break bin-compat to fix their bugs
 
6:02 PM
Which bugs?
 
@Mikhail mutex, condition_variable, future etc
 
Can you give a specific example of one of these? There used to be a terrible performance problem with MSVC std::mutex, but I think they fixed that?
 
6:21 PM
@Mikhail condition_variable is known to be broken is the one that comes to mind
 
Okay, but how?
I know condition_variable on Windows has slow response times unless you increase the priority, or PIC
 
@Mikhail the OS one isn't correct, and Casey Carter confirmed on SO main site the implementation in the v14x tools is broken
 
I mean, what's the exact problem? Does WakeConditionVariable behave outside the spec?
 
12
A: std::conditional_variable::wait_for, std::thread::sleep_for on Windows are affected by adjusting clock

Billy ONealThis was a known bug with VS2015's condition_variable which unfortunately is ABI-breaking to fix. I fixed it in our next major release (I completely rewrote the condition variable implementation from scratch), but I don't know when that will happen next. Note that VS2017 was a minor release as fa...

@Mikhail I had the discussion with Raymond Chen awhile back, I don't recall the specifics. Only that the semantics are wrong for a few reasons
 
Wow that's pretty fucked up, especially because the OS primitive is correct, so it's entirely due to C++ people
 
6:32 PM
@Mikhail very sure the OS primitive is absolutely NOT correct
 
At face value he says it doesn't meet all the requirements but I'm not sure which ones it doesn't meet :-)
Anyways, thanks for the link, its a good think to keep in the back my head
I once had to debug problems in an app when we were resuming from hibernate. Because I'm the greatest ever I gave up after a few hours.
 
 
1 hour later…
7:45 PM
Hi guys does someone know, what the terms build-tree and install-tree in the context of cmake refer to?
 
@Mikhail I need to try measuring these at some point. Because to date, I still don't know why Windows is so much better than Linux for my particular work-load using the same thread library written with pure C++.
Condition variables having slow response times might be a good thing if all the vcores are busy. But certainly a bad thing if there are idle cores.
*good thing in terms of throughput, but not latency.
 
8:09 PM
@Mysticial Take a look at: thesycon.de/eng/latency_check.shtml, I've found this tool extremely useful for identifying incompatible/fucked up drivers for the kind of high-throughput applications I work on.
Many server boards have latencies on the order of 800 us, while some single sockets can be as low as 50 us.
 
What do drivers have anything do to with it?
Wait, forgot that you mostly do GPU now.
 
I'll interpret that as you saying I have no clue what I'm talking about :-)
@Mysticial Basically, some drivers can hold the kernel for longer than you'd like. For example, the I had a CD-ROM that fucked with my DPC times, disabling that hardware device (Windows) brought the latency down.
If you don't believe me take a look at "Analysing drop-out problems with DPC Latency Checker"
 
It's not that I don't believe you. It's just somewhat irrelevant for what I'm trying to investigate.
 
The question is how long does it take for a std::condition variable holding a mutex to be notified
 
Does Windows have a global scheduling lock or something?
@Mikhail I can measure that directly by calling rdtsc from the signalling thread and again on the waiting thread.
 
8:16 PM
Yep, now the real question is what affects those timmings
If you want to be a bad person you can measure the difference between std::this_thread::sleep_for and the magic _sleep()
@Mysticial Anyways, to get better realtime performance on Windows I had to this, pastebin.com/raw/dEzZm6E4
gets you a decimal point finer than the Win32 api
 
@Mikhail Sigh... I'm not trying to get better realtime performance on Windows. For me, everything is great on Windows. It's Linux that I'm trying to find out why it sucks.
 
I just wanted to show off :-(
On Windows malloc on many PEs will lock up your mouse, on Linux it will result in allocation failure. Pick your favorite :-)
Anyways, if you listen to audio on both OSs you can hear the difference in interupt response times
 
8:34 PM
@Mysticial IIRC it's because windows is doing things in an unsafe manner that's technically thread safe
but not standard safe
@Mysticial not anymore
 
When did they remove it?
 
If I had to guess, they probably have a scheduling lock per processor group.
 
@Mikhail Looks like Windows 7
 
@Mgetz Which is also the same version they introduced processor groups. hmm...
 
@Mysticial I think the locks are actually per core, I think everything else is lockless IIRC
 
8:41 PM
Interesting, the question was motivated by an improvement I've seen going from Windows 7 to Windows 10
 
or mostly so
@Mikhail on what?
windows 10 is 'tickless'
 
@Mgetz Hmm... What about Linux?
 
@Mysticial I'd have to look
 
The Linux kernel had a big kernel lock (BKL) since the introduction of SMP, until Arnd Bergmann removed it in 2011 in kernel version 2.6.39,[1][2] with the remaining uses of the big lock removed or replaced by finer-grained locking. Linux distributions at or above CentOS 7, Debian 7 (Wheezy) and Ubuntu 11.10 are therefore not using BKL.
 
I think they are also per core now
well... logical core
 
8:42 PM
If the scheduling in Windows is truly distributed and decentralized, that could explain why my thread pool is so efficient on Windows. But it doesn't say much about Linux.
 
@Mysticial Linux has thread issues... and they are bad
I'd go so far as to say linux's threads are fully broken
 
@Mgetz oooohhh
 
yeah threads are basically processes in the same job on linux that share vmem
and for apparently legacy user space reasons cannot be changed now
so they are much heavier than threads on windows which are just tasks
 
The thread pool that I wrote in 2016 was designed to be decentralized with no (sustainable) contention on any single component. Fork-join tasks that spawn out to many tasks that need to be sent to different threads are done with exponential fan-out.
But none of that would matter if everything gets sequentialized again by the kernel.
I arguably over-designed the thing back in 2016. Since I wasn't sure if any of the underlying assumptions I made were even remotely correctly.
 
dunno
 
8:47 PM
But my thread pool beat out the Windows built-in thread pool for my purposes. So I called called it a day. Until I tried it on Linux. And found that it sucked - hard.
But as much as it sucked, there weren't very good alternatives either.
 
I'm a little confused here, so you're talking about the performance of the actual thread creation steps right? Not the runtime in them? I assume once you've made enough threads to fill the number of PEs you're not making any more threads?
 
@Mikhail The thread creation isn't the problem. They're either made beforehand or created on demand. It's the scheduling.
 
Okay, so you have more threads going at once than PEs?
 
correct
 
ಠ_ಠ
 
8:51 PM
Usually 2x.
I usually configure the pool itself to not limit the threads. So it will create as many threads as there are concurrent tasks. Instead, I do it at the caller/algorithm by controlling how many tasks to decompose.
 
@Mysticial on linux I'd suggest doing 1:1 with logical processors
I wouldn't exceed that unless you want pain with the CFS
 
@Mgetz I've tried that. The problem is that fork-join algorithms with overdecomposition doesn't have good "thread utilization".
The tasks aren't always the same size. And even if there are, there's enough jitter in the system to mess things up. So you have to overdecompose the tasks.
 
@Mysticial ah, so you can't do fibers?
 
The problem with limiting the threads to the # of cores is that the threads will block on the joins. Thus wasting a thread of execution.
 
Also not clear how number of threads relates to kernel locks
 
8:59 PM
@Mysticial not if they are fibers
 
My counter to that has been to remove the thread limit. And have 2x the concurrent tasks as logical cores. Then rely on the OS to efficiently switch out blocked threads to unblocked threads.
 
Maybe some minor O(log(n)) when you have contention, where n is the number of threads holding a mutex
 
@Mgetz I'd have to read about that.
 
@Mysticial fibers are userspace schedule tasks
they act like threads in almost all aspects
 
I've been teasing the idea of a new framework that is more hardware aware and tries to take over the scheduling as well. I can do all sorts of fancy work-stealing and shit. But I never got around to solving the problem of a blocking thread. One of the things on my to-do is to read into the C++ coroutine stuff.
 
9:02 PM
Wait, but his problem isn't creating the threads, fibers are certainly easier to make, its something to do with contention right?
 
@Mikhail The high-level problem is that the same code achieves significantly lower CPU utilization on Linux than on Windows. Thus the code runs slower on Linux.
I can't say much more than that.
 
If it makes you feel any better everybody in HPC knows this
 
@Mikhail "everybody"?
 
people I worked with
 
I don't know if it's contention or not. The pool is designed to decentralize and fan out. So under a perfect kernel, the pool will scale to unlimited threads, unlimited concurrent tasks, and unlimited task flow (tasks started/ending per unit time).
One hypothesis that I had is that the kernel might have some sort of broadly-scoped lock that's re-sequentializing all the parallelism that the pool is producing.
 
9:07 PM
@Mysticial nope it's trying to be 'fair
 
If that were the case, then the exponential task fan-outs would be much slower than expected. That would decrease the CPU utilization. But that's just a hypothesis. And even if it were true, it might not even be the primary factor.
 
hence why I said not to try to spam threads
because CFS will screw you
 
CFS?
 
"Completely Fair Scheduler"
you can eye roll now
 
lol
 
9:41 PM
Well, he isn't spamming the threads because they are pooled.
Also doesn't resource contention overhead scale (if at all) as something like O(log(n)), which means there shouldn't be too much difference between 32 threads and 64 threads?
 
@Mikhail I haven't tried on Linux. But on Windows, I can easily run hundreds or thousands of threads without a significant loss of performance. Backwards scaling in performance seems to start at around 4-8x the # of logical cores.
But it's hard to tell if that's because of the large number of threads, or it's because the algorithms are taking on additional computational overhead to expose the extra parallelism.
 
Or rather the serial section occupy a bigger fraction of the per thread workload
back when I did MPI, we'd scale until MPI part occupied 50% of the per work item walltime
What I haven't ever measured is "condition variable notify response time" vs "number of threads contending for the underlying mutex", might be fun.
 
10:00 PM
In a single-core world the notify would cause a context switch to the thread that is waking up. It was designed as a concurrency primitive, not parallelism. I wonder what the overhead is if the notifying thread is pinned to a different core than the wakeup thread.
 
@StackedCrooked There's probably sone data structure kept by the kernel that keeps track of which threads are ready to run and which are blocked.
A notify will mark the relevant thread(s) as ready to run.
 
I see.
 
If there are idle cores, then the reasonable thing to do is to schedule that thread on an idle core.
 
Yeah.
 
Subject to any affinity/pinning restrictions.
 
10:04 PM
I should do some microbenchmarks. I'm actually curious.
 
One of the things which I'm really curious about is how Cilk Plus and TBB release a blocked task.
 
Also the code should unlock the mutex before doing the notify. (It would be interesting to include that in the benchmark as well.)
 
If you have a thread that's running a worker loop, the problem is that the entire thread will block if the task you are running hits a locked mutex.
It's deep inside your call stack. You can't do anything about it.
 
AFAIK when using TBB you should avoid locks.
 
std::thread doesn't have an is_blocked function.
Nor does it have callbacks that get fired when the thread does get blocked.
And yet Cilk Plus and TBB seem to run fairly decently with exactly the # of threads as cores.
When one task gets blocked, that thread switches to another task.
How they do that, I don't know.
Because that implies swapping out the call-stack.
 
10:07 PM
Isn't that just OS scheduling?
 
@StackedCrooked No, it's still the same physical thread.
 
So they'd need to some how save the entire call-stack of the blocked task and save it somewhere.
This doesn't seem possible to implement strictly in C++ (minus the possibility of coroutines which I need to read about).
So it would have to be some OS native.
Now the question is:
 
That's what stackful coroutines do. They require some non-portable code.
 
Is it really more efficient to swap out the execution stack of the blocked task than to simply switch threads with a context-switch?
Because my thread pool implementation outperforms both Cilk Plus and TBB for my fork-join workloads.
 
10:10 PM
@Mysticial I think the difference is not that big.
 
The Windows built-in thread pool also beats out Cilk/TBB.
@StackedCrooked Do they actually copy the stack? Or is there some indirection somewhere?
 
They only need to backup the stack pointer.
 
Actually, they can't copy the stack because it's all in the same address space. So everything must remain visible to everything else in the process.
@StackedCrooked And all the registers.
 
Yeah.
 
That's a context switch.
 
10:12 PM
But, wthout switch to kernel mode.
 
oooooh
They do it manually.
 
Yep.
AFAIK, it requires some assembly that they have to implement for each platform.
 
So you would need to hook into the OS to know that the thread is blocked.
Then you manually set the register state of that thread to the new task.
 
I found one implementation. Doesn't seem to backup SSE/AVX registers though.
 
The Intel intrinsic headers have the _xsave() intrinsics for that purpose.
It maps to an actual instruction that saves the entire register state.
 
10:30 PM
@Mysticial Are you sure they aren't just using a custom mutex type?
 
@StackedCrooked No because it works through std::mutex.
When my threads block on std::mutex, Cilk/TBB seems to be able to re-task that thread.
But yeah, if I can figure out how to do this, then I should have all the tools needed to completely write my own scheduler.
Then I can take complete control of the hardware and bypass all the processor group limitation in Windows.
This implies that I can do it better than the Windows or Linux schedulers, which I don't claim to be able to do. But it's certainly worth a shot at to see what's possible.
 
A special purpose scheduler can be much faster than the OS scheduler.
 
Basically, I'd create one thread per logical core. And pin them to those threads and treat them as the cores themselves. With a proper coroutine setup that works with std::mutex, I can do my own scheduler. Use my own data structures for holding live tasks. Pick my own core assignments and utilize knowledge of the hardware topology.
Lots of options here. Not going to be easy do. But the parallel framework interface that my program has does allow for ambitious frameworks like this.
 

« first day (3044 days earlier)      last day (1889 days later) »