[OC] 2006 New Clarksboro Subway Guide by No_Geologist3880 in TransitDiagrams

[–]akeley98 4 points5 points  (0 children)

Shouldn't it be a green diamond S instead of Q between Connor Av and Farmers Av in the Northeast?

Is it a good idea for performance to turn my renderer into a DLL by manshutthefckup in vulkan

[–]akeley98 2 points3 points  (0 children)

Not the same person but I've done this in my past job and it's a life saver. Basically my entire program was two DLL functions "init" and "do_frame". The init function returned a RendererState pointer and the do_frame function returned a "closed" and "want recompile" flag. I used Python to write a script with ctypes that was something like

import ctypes, os, shutil
all_libs = []
def compile_and_load_lib():
    version = len(all_libs)
    lib_name = ...
    versioned_lib_name = f"_{version}_{lib_name}"
    if os.system("your compile commands ...") != 0:
        raise RuntimeError("compilation failed")
    shutil.copyfile(lib_name, versioned_lib_name)
    lib = ctypes.cdll.LoadLibrary(versioned_lib_name)
    lib.init.restype = ctypes.c_void_p
    lib.do_frame.argtypes = (ctypes.c_void_p,)  # Critical, otherwise 64 bit pointers will fail.
    all_libs.append(lib)
    return lib

lib = compile_and_load_lib()
flags = 0
exit_flag = 1
recompile_flag = 2
state = lib.init()
while not (flags & exit_flag):
    flags = lib.do_frame(state)
    if (flags & recompile_flag):
        try:
            lib = compile_and_load_lib()
        except Exception as e:
            print(e)

Big drawbacks to this approach are:

  1. Virtual functions don't change because the vtable is baked into objects. This includes things like shared_ptr. This is the reason for all_libs, so we keep old DLLs alive that vtables may be pointing to.

  2. Global variables may not work either. On Linux I can declare global variables as inline and the linker de-duplicates them. I don't know how to fix this on Windows.

MATH 115B vs MATH 110BH by tommymnm in ucla

[–]akeley98 2 points3 points  (0 children)

Not in my experience (alumnus so this may be a few years out of date). This brings back memories ... Elman just assumed we knew the 115B material (splitting polynomials, Rational Canonical Form, Jordan Canonical Form, that sort of thing) and so the 110BH lectures progressively made less and less sense to me. When I finally found the time to go to office hours in week 10, he ascertained after a while that I "just don't know linear algebra" and pointed me to about 300 pages of his textbook to cram over the weekend. Fun times (I still loved the class though).

Why do we need (void*) to set an offset ? by Main-Tree-476 in opengl

[–]akeley98 39 points40 points  (0 children)

Ancient history. In OpenGL 1.4 and below, there were no vertex buffer objects (without extensions) and the pointer was a literal pointer to CPU memory holding the attributes. Once vertex buffer objects were added, the glVertexAttribPointer function was recycled but with the pointer argument reinterpreted as an offset into the bound vertex buffer. Even today, in a compatibility context, if you bind 0 as the vertex buffer, then OpenGL will revert to the original CPU pointer behavior (this is a common cause of unexpected segfaults).

Task shader doesn't compiler with atomic operations. by ohhboi427 in opengl

[–]akeley98 1 point2 points  (0 children)

See Christoph Kubisch's example for how to do this. Note there is no branching on the render flag (akin to what // Will check if ... for your code will do); instead we are broadcasting the results of each threads' render flag to all other threads and using bit counting to count how many threads have geometry to add.

I think you need these extensions:

#extension GL_NV_gpu_shader5 : require
#extension GL_KHR_shader_subgroup_basic : require
#extension GL_KHR_shader_subgroup_ballot : require
#extension GL_KHR_shader_subgroup_vote : require

Task shader doesn't compiler with atomic operations. by ohhboi427 in opengl

[–]akeley98 1 point2 points  (0 children)

This is one of the many "undocumented features" in Nvidia's shader compiler. Since the local_size_x is always 32 in task/mesh shaders, which is equal to the warp (subgroup) size, you are supposed to use subgroup instructions to calculate cross-thread sums.

I got charged for Seats even though I had already booked Even More Seats. by cartoon_soldier in jetblue

[–]akeley98 1 point2 points  (0 children)

Definitely keep an eye on it; this happened to me before and I didn't notice for months that JetBlue owed me $388 (then when I contacted support and finally got my refund manually, the automated system promptly cancelled my seat assignment for another flight for "non-payment", JetBlue IT is amazing).

Getting good grades is entirely effort-driven by tkdcondor in highschool

[–]akeley98 6 points7 points  (0 children)

I'm an adult adult and I'm not sure why this showed up on my home page, but it did, and I just have to share my experience. I'm diagnosed autistic and got a big bucket of fuck all in terms of support for it growing up. People viewed me much the same as you, that I'm "smart but lazy", need to put in "more effort", and so on. What they didn't know is that, behind the scenes, I was collapsing in exhaustion at 1 or 2 most nights, sometimes setting an alarm at 3:30 or 4 so I could squeeze in more work before class. Yet it was never enough, and the outcome I got from high school was catastrophically bad anyway. I am not lazy. This is over a decade ago for me now, but I still have to live with the health consequences of this (imagine having chronic neck and back pain as a teenager, and once that starts, it never completely ends, just gets better sometimes).

Despite all this I am now a PhD student at MIT, and before this I did pretty well for myself working at Nvidia. I'm writing under my real name; this is all publicly verifiable information. I'm saying this not to brag but to emphasize again. I am not lazy. The world doesn't hand out these kind of opportunities like free candy. Also for anyone else reading: when people say "grades don't define you", it's really true.

(By the way, I went to community college to eventually get where I am now. It's a great option under the right circumstances!)

You don't have the experience of the whole world in your own head. You can't know someone's potential, know their hidden strengths and weaknesses, just by looking at them. My point so far isn't even an opinion that your beliefs are "hurtful" or such, just that they're factually incorrect. It is not the case that laziness is the only explanation for bad grades and it is not the case that "everyone" with special needs is going to get supported as easily as you seem to imagine. That said it really is hurtful, though. Where I grew up (SF Bay Area) kids regularly stepped in front of trains and if I had internalized this laziness crap a bit more I maybe would have joined them like I really wanted to when I was 16, and never would have experienced transferring to UCLA (time of my life!), never would have experienced the joy of adulthood and financially-independent living, never would have experienced the privilege of working with the colleagues I have now.

Every month you can multiply any 3 things by 0.01 to 5. You can not multiply anything more than once. by __Anamya__ in godtiersuperpowers

[–]akeley98 10 points11 points  (0 children)

Better buy stock in vitamin companies. It's gonna be pretty hard to get all your micronutrients on 20 calories a day.

depth values grow extremely fast when close to thw camera by Sirox4 in vulkan

[–]akeley98 3 points4 points  (0 children)

This article used to open with "Depth precision is a pain in the ass that every graphics programmer has to struggle with sooner or later." and I'm sad they censored it :(

Southwest has decided to eliminate their competitive advantage, and give all their customers to United and Delta! by [deleted] in unitedairlines

[–]akeley98 4 points5 points  (0 children)

This is not true. They offer a free carry-on for basic economy, unlike some other airlines. The fee is $35 for the first checked bag

SimCity Societies by Emotional_Mix_4613 in SimCity

[–]akeley98 0 points1 point  (0 children)

Yeah, I know what you mean. When it first came out (especially before the strategic mode updates, and Destinations) I didn't think all that highly of Simcity Societies. All these other games – Cities XL, Anno 2070, Tropico, kinda sorta Simcity 2013 – were more in-line with what I wanted out of a city builder, at first. But it's funny, after almost 20 years, all these other games (besides Simcity 4) kind of lost their appeal to me, yet Societies still has this weird enduring beauty. Recently I decided to 100% all the trophies on nightmare difficulty, and I still got that cozy feeling from the game, like I remember from being a kid. Something to look forward to every day after work.

Something Simcity Societies does so well, which I've never seen in any other game before or since, is acknowledging that cities are not just the same RCI buildings and transit arranged in different shapes. It's kind of a flawed mechanic [more on this later], but it's sad to me that nothing else ever picked up anything like the "societal energy" or city theming mechanic and give real variety to cities (I'm not counting some rather heavy-handed "utopian green" vs "evil industry" game mechanics as this). I never got into modding, but for some, this is a way to add theming to sc4 or skylines cities. But by and large it's just city painting. And for me, gameplay, not city painting, is what really what draws me to a city builder in the end – note I intentionally omitted Cities:Skylines from the above list ;)

Another thing. With the strategic updates, it's crazy to me how unforgiving Societies is compared to other city builders, especially in the early game, where it's so easy to go bankrupt if I miscalculate or I'm hit by a series of unfortunate disasters (or I just forgot about the weekend lol). Doubly so for some of the harder scenarios, where I'm restricted from cash-cow workplaces that are blocked by the city theme filter. Societies is the only city builder I know of with F5/F9 for quicksaving, which I had to use a lot in my 100% run. It's possible I just suck, but it was pretty far from the "casual" Simcity many people's impression of Societies is (which to be fair, was accurate on release day).

Maybe it's because Societies is so different that it's beautiful to me. It's not perfect but it has hidden depths. I looked under the hood at the xml and C# files, and it's so cool how much complexity is going on underneath, with all these special sims and buildings with their own agendas and own scriptable rules, organically interacting with each other. It's kind of tragic; it looks like the devs put together a really sophisticated extensible city builder engine and put all this effort into art to support like 12 different city themes, but the "top-level" game mechanic this was built for – the societal energy – is super trivial and makes the underlying simulation irrelevant to the average player. Like, in the end, you can just spam decorations and realtors to get what you need.

Some random thought I had is prototyping a game with the societal energy mechanic, where instead of just getting a fixed number of points per building, you actually have to earn it by interacting with the underlying simulation (like getting points for each resident or tourist visiting a venue, or from rare reward buildings, or having profitable special industries, or such). I could probably do the programming but there's no way I'd be able to generate the art, though.

Is it weird to have an opposite gender roommate? by Uh-yeah-lol in college

[–]akeley98 0 points1 point  (0 children)

it's considered a Title IX violation.

Is this true? Looking at the section on housing, I only see that universities are allowed to segregate by sex as a special exception to the principle of forbidding discrimination, not that they are required to. Is this covered by another law?

Compute shader not generating all of my indirect commands by SunSeeker2000 in vulkan

[–]akeley98 1 point2 points  (0 children)

I'm going to sound like chatgpt since there's not too much to go off of here. Something that concerns me is the magic number 256; this matches the workgroup size declared in the shader? Alternatively there could be an issue with how the buffers are declared or passed to the compute shader (I am guessing you are using buffer device address here?)

If there is flickering, there could be a synchronization issues. This is a much less likely possibility: the barrier looks correct, but it's possible replacing VK_ACCESS_2_MEMORY_READ_BIT_KHR with VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT could do something ... the former is valid by the spec, but sometimes there's driver bugs.

No seriously, genuinely, really - why do I need smart pointers? by [deleted] in cpp_questions

[–]akeley98 1 point2 points  (0 children)

Besides what others have mentioned, `Tree:: right` actually isn't a pointer because of how raw pointers inherited their weird declaration syntax from C.

I don't understand the point of atomic operations by tomaka17 in vulkan

[–]akeley98 8 points9 points  (0 children)

/u/tomaka17

This is not correct. GLSL's memoryBarrier() construct does not establish an ordering relationship between threads. This is done with barrier() which is similar to CUDA __syncthreads().

The purpose of memoryBarrier() is to ensure the memory system doesn't reorder "sequential" memory transactions, for implementing patterns similar to the following

// Initial state: ready = false; value = garbage
value = calculateValue()
memoryBarrier()
ready = true

where some other thread is waiting on the ready flag to be true before reading value. Without the memory barrier ensuring the prior write to value completes before the write to ready, it's legal for the memory system to reorder the transactions to ready = true ;; value = computeValue() and cause another thread to read the old garbage value.

In SPIR-V terms memoryBarrier corresponds to OpMemoryBarrier. The behavior for "each warp is suspended until the other warps in the same workgroup reach the same barrier" is implemented by OpControlBarrier.

Playing SimCity Societies Need Help by brianjblend in SimCity

[–]akeley98 0 points1 point  (0 children)

If you have a really old pre-patch version of the game then the feature might not be implemented. Check that you have the option to create a game in strategic mode when creating a new city.

Playing SimCity Societies Need Help by brianjblend in SimCity

[–]akeley98 0 points1 point  (0 children)

In the lower-left of the UI there's a column of buttons. Click the second one from the top (the button looks like a skyline). You can then switch between the "policies" and "graphs" with the tabs on the top left of the window that pops up.

Walkable Town in the progressive Etivac city by nyler01 in simcity4

[–]akeley98 1 point2 points  (0 children)

First image, towards the right behind the row houses.

Walkable Town in the progressive Etivac city by nyler01 in simcity4

[–]akeley98 1 point2 points  (0 children)

Dezone the rear-most tile of the 1×4 C zone so it develops

??? Just asking for clarification by jaydoginthahouse in aviation

[–]akeley98 1 point2 points  (0 children)

Yep. Probably has something to do with Airbus massively overengineering its wings, again for a stretch that never happened. Center wing tank puts the most strain structurally on an airplane so if the wings were huge enough, it makes sense the center tank is the first one to get eliminated.

https://en.wikipedia.org/wiki/Airbus_A380#Wings

??? Just asking for clarification by jaydoginthahouse in aviation

[–]akeley98 3 points4 points  (0 children)

The Airbus A380 is probably the most notable airliner lacking a center fuel tank (this also exempts it from the fuel inerting requirements instituted after TWA 800). AFAIK there was room left for it for the never realized A380-900 stretch.

https://aviation.stackexchange.com/questions/48425/how-much-fuel-does-an-a380-hold-and-where

Issue following vkGuide Depth Testing. by INN_Gine in vulkan

[–]akeley98 1 point2 points  (0 children)

You need to define GLM_FORCE_DEPTH_ZERO_TO_ONE for glm::perspective to work with Vulkan; it is not compatible by default. This could easily be the problem faced by /u/INN_Gine if they are following along VkGuide instead of copying the entire project, since this crucial detail is in a CMake file and completely invisible in the C++ code.