« first day (1806 days earlier)      last day (3144 days later) » 

2:00 AM
as soon as I saw the push_back and the std::swap of the containers, I assumed it was the classic queue out of stacks example
 
Yeah. it's slightly differerent.
 
@StackedCrooked what devector does is something similar, but much more sophisticated, and across all operations
 
@StackedCrooked Not really so weird--just a degenerate case of std::deque where you limit it to two vectors instead of an arbitrary number.
 
The classic CS question involves transferring/reversing all elements. This would be bad if you have 10k+ elements. It would take many cycles and thrash the cache.
 
user406009
@JerryCoffin You would also need a special allocator.
 
2:04 AM
@StackedCrooked yes, but in the classic CS question your building blocks are less powerful (stacks instead of vectors)
 
Vector is essentially like a array-based stack.
 
@StackedCrooked in CS theory a stack can only be modified at the top
 
user406009
@StackedCrooked Have you benchmarked your queue against std::deque yet?
 
No.
It was just an experiment.
Not using it for anything serious yet.
 
2:07 AM
oh good news
 
Would be interesting though.
 
I can apparently use github.com/orlp/pdqsort for a school assignment article
so I get an excuse to write an article for it and also get credits for my study
 
I expect the deque is faster at growing initially since it doesn't require realloc+copy. After a stable size has been reached I would expect the dual-vector thing to be faster.
STL mentioned a few times that deque is not cache-friendly.
 
deque is kind of an abomination
 
vector + reserve beats almost everything :D
A year ago I posted this here. It is a simple container test and operator new is overloaded and prints each allocation/deallocation.
This little bit of visualization changed my perception a lot.
Before I didn't really realize that a set requires one allocation+deallocation for each single node.
Also 40 bytes for one node containing int. That's more than half a cache-line per element. This cannot possibly scale well :)
 
user406009
2:17 AM
Why doesn't std::set use a btree type structure?
 
@orlp Benchmark doesn't show quicksort?
 
user406009
Iterator invalidation guarantees?
 
@Lalaland Dunno.
 
user406009
With a btree of the appropriate size, you shouldn't see that much inefficiency in the std::set.
 
user406009
Probably not too much worse than std::deque
 
2:19 AM
flat_set is pretty good. in this little benchmark it beat set in both lookup time and insertion time. The latter surprised me.
a good hash beats flat_set for lookup of course :D
@Lalaland btrees are interesting.
not sure if boost has any
Oh wait, my benchmark sucks.
It inserts elements of incrementing value.
So of course flat_set will be fast.
 
user406009
Lol
 
Anyway lookup time test should be valid.
 
user406009
I switched it to rand.
 
user406009
And now the flat_set one is pinging my cpu at 100%
 
user406009
-1/10
 
user406009
Sorry about the wasted CPU cycles on coliru.
 
user406009
I had to try it.
 
user406009
O(n^2) is a hella a drug.
 
@StackedCrooked quicksort is O(n^2)
@StackedCrooked introsort is in quicksort's place
 
@Lalaland Oh. flat_set sucks..
# 500,000 elements
flat_set: creation_time=24492ms lookup_time=126us
std_set: creation_time=236ms     lookup_time=153us
 
user406009
2:36 AM
To be fair though, as long as you stay below ~10,000 flat_set still beats the heck out of std_set.
 
user406009
Really depends on your input size.
 
The flat_set has only minor advantage for lookup over std::set.
 
I generally believe you should stay away from hash based data structures until benchmarking has proven the tree based data structure is the bottleneck and hash based data structure significantly improved over it
the tree will always perform well
 
user406009
The problem is that we deserve better tree based structures in the standard lib.
 
However, in a real application where the cache is being used by other parts of the program the flat_set might have the advantage due to reduced footprint on cache.
 
user406009
2:38 AM
WHERE ARE MY B-TREES!
 
the hash based data structure might perform amazing
 
user406009
@orlp And you can make that tree immutable relatively easily :P
 
user406009
@StackedCrooked Small sets are the killer use case. <100 elements.
 
# size: 10,000,000. lookups: 10,000,000
creation_time=4801ms   lookup_time=215694us # std::unordered_set<long>
creation_time=10866ms lookup_time=344545us # std::set<long>
# size: 1,000,000. lookups: 100,000
creation_time=409ms lookup_time=15174us # std::unordered_set<long>
creation_time=601ms lookup_time=7369us   # std::set<long>
# size: 10,000. lookups: 10,000 (with many searches for non-existing elements)
creation_time=1ms lookup_time=436us # std::unordered_set<long>
creation_time=1ms lookup_time=300us # std::set<long>
 
2:55 AM
@StackedCrooked now try std::string with long strings and/or long pre/suffixes :)
 
# size: 10,000. lookups: 10,000 (all searches for existing elements)
creation_time=891us lookup_time=309us # std::unordered_set<long>
creation_time=1272us lookup_time=800us # std::set<long>
 
So you need 100K elements on a coliru-grade computer before std::unordered_set starts outperforming in lookup.
Ah, for existing stuff, std::unordered_set gets things done
 
hash is generally faster but it has a bad worst case
unordered_set/map allow some tweaks like load_factor. haven't looked into that.
 
19 mins ago, by orlp
I generally believe you should stay away from hash based data structures until benchmarking has proven the tree based data structure is the bottleneck and hash based data structure significantly improved over it
 
I have like
unordered_map's for everything
Even things that only have like 10 elements
I'm probably losing out there.
 
2:57 AM
analogy
you have a racecar and a regular car
 
For 10 elements you can use linear search.
 
you have to do groceries
 
The hash calculation is probably more expensive than 10 iterations.
 
if your grocery store is at the end of a racetrack, sure pick the racecar
the regular car is always a safe bet, but the racecar might not always be the best choice
 
hm...
you can take the bike or catch a taxi. taxi is faster unless you didn't manage to catch one :D
 
2:59 AM
@orlp If I can break traffic laws, RAAACECAAR
 
obviously, when you've properly analyzed the route ahead, and you found that it's worth optimizing for it, you might pick the racecar
but I definitely wouldn't choose the racecar by default
 
unordered_map requires careful choice for hash algorithm.
A bad choice can lead to very bad performance.
 
it just annoys me
 
Ell
I pick unordered_map for semantics
 
While map has upper bound of log(n). So it's a safe choice.
 
Ell
3:01 AM
map is ordered
 
that often people say 'I'll just a hashmap' when they really mean 'a map'
 
Ell
I haven't encountered a use case for ordered maps yet
 
@Ell map sucks
 
@Borgleader solid argument 10/10
 
fact is that map is never fast
 
3:02 AM
@StackedCrooked define fast
 
Ell
@orlp 120MPH
 
@Ell metric
 
map requires allocation per node. and cache-unfriendly binary search.
 
or gtfo
 
Ell
3:03 AM
160Km/h
 
@StackedCrooked how is that different from set?
 
set is the same
 
@Mysticial now now
 
@Mysticial off by one error
american officially uses metric :D
like, don't get me wrong, unordered_set and unordered_map are great if you've put in the effort to make them great (or got lucky)
but until benchmarking has shown that's worth it, I believe that choosing the slow map/ set is the wiser choice
consider user-defined types as well
making a total order function is easy
 
3:07 AM
but on the other hand, if you're gonna put in so much effort then you can go for google dense hashmap or something.
 
writing a proper hash is hard
 
cuckoo hashing also looks interesting
I should check that one out.
 
Ell
@orlp even though usually the unordered semantics are desired?
 
@Ell wait
 
Ell
why?
 
3:08 AM
what do you mean
 
Ell
that makes no sense :3
 
the unordered semantics are desired?
do you mean `the ordered semantics are not needed'?
 
Ell
well, usually you don't need the order in your map
 
or do you really mean ' I want disorder'?
 
Ell
the former :)
 
3:09 AM
in that case, map/set is fine
 
@orlp Scott's latest blog post seems to say otherwise.
 
@StackedCrooked link
 
Ell
@orlp but why would it be default?
one should go for the data structure with enough features and no more
ie, if you don't need order go with unordered
 
because their names "map" and "set" are the least specialized
 
3:11 AM
@StackedCrooked "lookup-heavy applications", " a million doubles, a million lookups"
 
all these are heavy performance scenarios
sure, in that case, choose whatever is the most performant
 
if performance doesn't matter then neither does the choice between map/unordered_map
 
but map/set is the default choice for when you don't need maximum performance
@StackedCrooked that's not true
map/set can not become degenerates
that's important for the non-heavy computation parts
on top of that, creating total order for custom types is easier than writing proper hashes
 
I still need to create sorted<T>
Which takes an unordered sequence and inserts things in sorted order.
 
3:13 AM
@ThePhD priority_queue?
 
@orlp Lookup is upper bounded by log(n). But they are very bad for iteration.
 
@orlp priority_queue puts things in some "heap-like" order.
It doesn't mean that I can get its container and iterate through the container and have that iteration be in order.
 
Iterating a large map is just as bad as iterating a large list.
 
@ThePhD multiset?
 
Ell
ugh I feel like shit
 
3:15 AM
@orlp no, heap is contiguous storage
 
@Ell are you feces?
 
Ell
no :(
 
Heap is a nifty data structure.
 
@StackedCrooked I'm aware
I was proposing an alternative to ThePhD
 
Are you proposing?
@orlp Ah. Sorry.
@orlp seems the best choice.
 
3:17 AM
@StackedCrooked StackedCrooked? Will you chat with me?
 
YES
music
 
YOU MAY NOW COMMUNICATE WITH YOUR ASSIGNED CHATTEE
@StackedCrooked we talked earlier about the swap and pop and intrusive pointers
 
@ThePhD but you can pop each item into a vector
 
@StackedCrooked I actually used both in conjunction for my garbage collector
 
3:21 AM
(I'm actually kind of proud of it)
it's a GC that can be used for any C++ type
 
Is line 179 special?
 
that's where the swap / pop happens, and the intrusive reference gets updated :)
(although it should probably be called move / pop)
 
looks interesting
 
@ʞɔᴉN Dude, Topre testers came out!
Victory screech!
Woleoleolololeoloeelolo!
 
@orlp And only that type, or all types?
 
3:26 AM
@ThePhD you can mix types
@ThePhD you just have to register the type before using it
 
Also, what's missing in your devector implementation?
I see that
but is there anything like, glaringly incomplete?
 
@ThePhD yes
not all exception guarantees are correct
and there are some functions just missing
 
Damn
OpenGL is a fucking mess when it comes to textures.
Why can't I just upload some fucking data.
@Borgleader save me q_q
 
@ThePhD you have to ask nicely
and first two dates
then you can start talking about fucking
 
Wine & dine.
 
Ell
3:29 AM
jesus it's so late
I need to drink water though
 
@orlp Cuddling first.
 
you know the intro page for devector is kinda funny. People won't care about your list of typedefs :P
They want speed!
 
@StackedCrooked it's more of a documentation than intro
 
gl::TexStorage2D(gl::TEXTURE_2D, static_cast<GLint>(1), gl::RGBA8, static_cast<GLsizei>(width), static_cast<GLsizei>(height));
    gl::TexSubImage2D(gl::TEXTURE_2D, static_cast<GLint>(0), 0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height),
        gl::RGBA, gl::UNSIGNED_BYTE, flipped_data.data());
@ThePhD ^
 
Wut.
Where'd you get that?
 
3:31 AM
My font code why
 
Oh.
I didn't see that in llogl.
 
@Borgleader it's wrong
 
llogl is mostly wrappers around the resources themselves
to manage their lifetimes without me having to call glgenX/glDeleteX
 
Oh.
 
I added a few methods to some of the types to better encapsulate the ids, so i didnt have to use get_id so much
but mostly its for lifetime management
 
3:35 AM
Ah, I see.
AAAWH FUCKIN'
titties, upside-down OpenGL bullshit
 
Ell
night folks
 
Good night, I love you.
Sleep tight.
 
 
I'm of too, night all.
 
Nighty night, sleep tight.
 
3:45 AM
@ThePhD GOOD MORNING!
XD
 
@Borgleader Wait, come back, don't leave me alone with him. ;~;
 
@ThePhD just me and u bby
 
user406009
At least I'm still here.
 
Order Summary
Item(s) Subtotal: EUR 2,25
Shipping & Handling: EUR 23,23
Total before tax: EUR 25,48
Estimated tax to be collected: EUR 0,00
Grand Total: EUR 25,48
Fuck that.
 
i'M STILL HERE (but nobody loves me) reMIX pt.II ft. Cinch
 
4:01 AM
@StackedCrooked Good call.
 
@JerryCoffin pssst can i ask you something
 
@VermillionAzure Yes. Oh wait, you just used up your question and answer.
 
@JerryCoffin QQ
 
@VermillionAzure So what's up?
 
user406009
I have decided that Alexandrescu has the most entertaining talks.
 
user406009
4:11 AM
Everyone else gets sorta boring.
 
@Lalaland He does seem to be pretty charismatic.
 
@JerryCoffin So ummmm
I was wondering if there was interest in "true AI" in your current occupation or perhaps in your career
I'm interested in developing a true artificial intelligence system that's able to reason and then learn and such like that...
 
user406009
@VermillionAzure Many people are.
 
user406009
So far they have gotten jack shit.
 
user406009
After decades of work.
 
4:18 AM
@Lalaland I've been meaning to try something... It's probably not practical, but I think AI is a big deal in a lot of people's minds and I wanted to try and apply some naive ideas if anybody had that sort of interest in it.
 
@VermillionAzure I dunno. For decades now, "AI" has basically meant "things we don't know how to do well" and the minute we figure out how to do something reasonably well, it's no longer "AI". Maybe I'm just jaundiced though.
 
@JerryCoffin I've been wondering why nobody's tried to do some unified theory on general AI or something. I'm just an undergrad so I dunno. Any hearsay about that sort of thing?
 
user406009
@VermillionAzure Artificial neural networks are sort of an attempt at that.
 
@Lalaland Yeah, but they're very low-level, right?
It's like trying to build an entire video game in assembly. Very few people can make complex games like that unless you're Mr. Roller-Coaster Tycoon
 
It's the fundamental problem that there is no way a computer would be able to figure out how to learn or what to look for without taking Until The Heat Death of The Universe.
Even Neural Networks have to be pre-configured with "filters" and pameters that it will use and stack together to perform the tasks that people want out of it. That kind of tweaking requires design, and once you step into that realm you step out of the ability of computers: i.e., execute instruction X when given instruction X in the way that I was made to.
 
4:27 AM
We are driven by our primal motivations. And intelligence is a layer on top of that. Computers don't have any motivation. They don't care.
 
user406009
AI is theoretically possible though.
 
user406009
I mean, we are made out of very physical processors.
 
@StackedCrooked But of course!
 
@StackedCrooked Let's make 'em care!
 
user406009
Worst case, we can just do physics simulations on human brains.
 
4:28 AM
It's theoretically possible, maybe, but you'd need a Neural Network that tells ITSELF what to look for. That means evaluating its inputs and outputs on its own, including using itself as input.
(And evaluating itself as output: e.g. "Am I doing what I'm supposed to be doing?")
 
@ThePhD Well, it doesn't have too be like that, though
A simple AI could just start from {True, False, Unknown} and take it from there
 
@ThePhD e4 e5
 
That doesn't give it intelligence.
Or self-reflection. Or any of the other things necessary to make its own (sound) decisions.
 
user406009
There are theories that intelligence requires large amounts of data input.
 
user406009
Anyways I don't think we anywhere near human level AI.
 
user406009
4:32 AM
We would at least need cat-level AI or something first.
 
user406009
And we don't even have that.
 
And then you'd have to deal with robot-ethics.
 
user406009
Those debates go in circles.
 
user406009
Is specieism morally valid?
 
user406009
Are we allowed to "unfairly" discriminate based on species?
 
4:33 AM
@ThePhD Java a has reflection API. We could start with that.
 
user406009
What makes an entity have rights and moral standing?
 
user406009
Etc, etc.
 
@VermillionAzure I think most people go into things with a little too much idea of the answer to ask the questions necessary to pursue a general theory.
 
user406009
@StackedCrooked Good. If the AI overlords rely on Java reflection, then we will know their true weakness.
 
user406009
They will bow to the power of generics or face destruction.
 
4:35 AM
@Lalaland Intelligence?
 
user406009
@Nooble So 1 year old kids have no moral standing? I can just go around raping and killing them?
 
@Lalaland sure
Until they are 3, that is.
 
@JerryCoffin what do you mean?
 
Then you must slow down.
 
@Nooble Well it can be modeled I think
If you look at humans, it's pretty clear that a lot of people have different "core" values based on the way they live and such
 
4:37 AM
@Lalaland Hmm...
 
But most people usually want to avoid pain. It's pretty universal until they have some sort of disorder or event to dislodge that core value
If I were to make a simple AI that only had one goal, like "find sunlight," it could just live by that one core value--"find sunlight"
 
@Lalaland Maximum attainable intelligence?
 
user406009
@Nooble Do retards have rights?
 
user406009
Or should I start enslaving them to work on my marijuana plantation?
 
4:40 AM
@Lalaland :(
 
@Lalaland TBH an AI without any values would be extremely dangerous. The answer to that question would depend on which aspects they'd like to attain with their actions
 
@StackedCrooked @EtiennedeMartel would probably like it though.
 
@JerryCoffin what do you mean by "go into things with too much idea of the answer?"
 
@VermillionAzure Wanting a specific answer.
 
user406009
4:42 AM
@Nooble Like I said, it's a complicated topic. Truthfully, I agree with you, rights should be relative to the obtainable intelligence passing a certain threshold. However, that leaves unanswered questions about large proportions of the human population who are unable to meet even bare minimums.
 
user406009
Read philosophy essays if you want to learn more.
 
user406009
You will find most discussions of this sort when debating either animal rights or abortion.
 
@Lalaland Intelligence != life
 
@VermillionAzure I mean they go into things thinking that neural networks are the answer. Or they might have another implementation, but it doesn't make much difference. They don't even think of a generalized theory of AI, because most seem to make up their might about the general theory very quickly, and from there it's just a matter of deciding how deep of a neural network to build, how to make it run faster, etc.
 
@ElimGarak is this you bae? github.com/domagojk
 
4:44 AM
@JerryCoffin To me, it seems like they're just pseudo-statistical logistical systems that have good utility and mock intelligence.
 
user406009
@ʞɔᴉN I doubt it. I don't think he would touch JS that much.
 
user406009
Unless it was WebGL related.
 
user406009
@JerryCoffin Well, we know that neural networks work.
 
@ʞɔᴉN I think it's you Nick.
 
user406009
So it does make sense to approach a problem with a solution you know will work.
 
4:47 AM
@Lalaland yeah, that's what I was thinking
 
NickScript.
 
@Lalaland But the fact is that people are ethically concerned about AI and want to know how a truly consciously and intelligent AI might act.
 
@Nooble no he actually wrote some code
 
@VermillionAzure Like a human?
 
@Lalaland They do some things well anyway.
 
4:48 AM
@ʞɔᴉN Oh! That changes things.
 
@Nooble No.
 
user406009
@VermillionAzure Yeah. We humans come with so many built-in incentives to behave civilized. Yet we still murder each other.
 
@Nooble Octopuses and dolphins and elephants and chimps are intelligent. They don't act extremely like us, but they're somewhat similar and also different.
 
@VermillionAzure if you build your neural network deep enough I don't really see how it's different from an organic mind
 
user406009
(By "built-in incentives" I am referring to things like empathy)
 
4:49 AM
@ʞɔᴉN Because a mind can reason and abstract and change its thinking and learn new ways of thinking.
 
user406009
@ʞɔᴉN That simulation would require more processing power than we have.
 
I highly doubt a neural network will spontaneously learn to reorganize itself based on a completely different domain than it was designed for without design to help it along.
 
user406009
@VermillionAzure Why not?
 
@VermillionAzure Isn't this just concern for varying levels of intelligence?
 
@Lalaland Because we don't have the power to do it right now.
 
user406009
4:50 AM
We are basically composed of neural networks and we seem to do fine.
 
@Lalaland But the way we think is much higher level than number crunching and statistics
 
user406009
@VermillionAzure Yes, but the brain mechanics are quite close to a neural network as far as we know.
 
If we were based on numbers and fine concepts, why did we have to first learn such concepts and train ourselves?
 
user406009
The main difference is that we don't have the computing power yet to simulate it.
 
@ʞɔᴉN Wait no, he wrote JavaScript.
 
4:51 AM
@Lalaland I think it'd be better to do something higher-level
 
@VermillionAzure you're talking to me from over 2000 miles away because we have this nice chat client built upon layers and layers and layers of lower level technology
 
user406009
@VermillionAzure I think that has been tried before. Look into the AI winter.
 
when it all comes down to it, its just bits flipping
 
user406009
@VermillionAzure Specifically "expert systems"
 
@ʞɔᴉN But a chat system is not intelligent. It doesn't dynamically modify its own behavior outside of its domain and "design"
 
4:53 AM
@ʞɔᴉN Wow, you're so smart. Do you happen to be a backend engineer?
 
chat has nothing to do with intelligence. nooble here is proof
my point is, high level stuff like behavior is just abstractions on top of really low-level concepts
sentience, empathy, etc
 
@ʞɔᴉN Eye-opening!
 
user406009
@VermillionAzure If we had a neural network large enough to simulate the human brain, you don't think it would work?
 
@Lalaland I don't know, but I'm not interested in waddling around until we bundle enough to get it to that point.
 
I'm just a--I'm just a machine.
 
4:55 AM
@ʞɔᴉN But there's a lot that we don't know, ya know? And things are consistently changing as well.
An example: DNA and RNA are the genetic code for the body that's "supposed" to be static, but the truth is that it is mutated and even repressed through radiation, and even diet changes through menthylation.
 
user406009
@Nooble I am afraid it is time to tell you the truth Nooble. You are actually a brain in a jar. Everything you thought you have experienced has just been a simulation through wires connected directly to your brain. Your whole life has been a lie.
 
and btw you'll find that intelligent, adaptable minds don't modify their behavior all at once. it's basically all based off past experiences.. interactions, feedback, stuff like that
 
@Lalaland The better answer is I don't know and I don't want to say yes or no. I don't want to believe yes because that'd be too boring and simple.
 
we are not so amazing as we like to think :P
 
user406009
^
 
4:58 AM
@Lalaland I can't disprove you, so you must be telling the truth.
 
@ʞɔᴉN Yes, but there's some things that we also cannot change. And there are reasons why we don't change ourselves as well. There are reasons we like to change things on a whim and others can never change because of trauma
Even if we are a deterministic system, it's far from simple. It's why we can't simulate it with a simple neural network system as well.
 
@ʞɔᴉN Interesting, I thought it would've been based on future experiences.
 
user406009
We are a deterministic system though. As we are physical creatures in a physical world.
 
@Nooble ty 4 ur contributions bb~~
 
@Lalaland I can't disagree nor agree with that. But what we think are the relationships and mechanisms are not necessarily correct--physics is the best example of this revisionistic learning we go through as we understand more.
 
4:59 AM
Hey if I had a machine that had all the information about everything in the world, could I predict the future?
That would be great.
 

« first day (1806 days earlier)      last day (3144 days later) »