Computer Model That Locked Down The World Turns Out To Be Sh*tcode -

Marissa Moira

kiwifarms.net
So lemme get this straight.

A bunch of scientists slap some spaghetti code together-- code that is so inaccurate and poorly assembled, it gives you different numbers depending on what computer model its on, and then they base their findings about the Super Coof Death Toll upon these shoddy predictions... and we don't even know if these locks and shutdowns were even necessary, because the Alarmists screamed bloody murder.

This day has barely started for me and I'm already tired just from hearing this.
Global Warming has the same type of care given to the 48+ models that exist for it.

This isn't new, but then people wonder why other people question it.
 

Sam Losco

True & Honest Fan
kiwifarms.net
Sources are... Whatever but this is confirmation bias for me. I generally don't trust model outputs as 100% truth because computers will output WHATEVER THE FUCK YOU PROGRAM THEM TO OUTPUT.
People that assume models are always right are idiots.
I was also wondering how they were getting any kind of accurate modeling for this shit when no one even knew anything about it yet.

Their real model was probably just them playing Plague Inc.
 

Harvey Danger

getting tired of this whole internet thing
kiwifarms.net
So lemme get this straight.

A bunch of scientists slap some spaghetti code together-- code that is so inaccurate and poorly assembled, it gives you different numbers depending on what computer model its on, and then they base their findings about the Super Coof Death Toll upon these shoddy predictions... and we don't even know if these locks and shutdowns were even necessary, because the Alarmists screamed bloody murder.
You've been green-pilled. There's a reason so many "climate deniers" start out noticing the terribly coded climate models, which are so bad at predicting they spawned the field of chaos theory itself.

...wait they did the same fuck-up in epidemic modeling? For fuck's sake, science, get your shit together.
 

Gustav Schuchardt

Trans exclusionary radical feminazi.
True & Honest Fan
kiwifarms.net
Am I reading this right? argv is an array of C-style strings which they are steadily walking through character by character within the if conditionals? That's why I'm stuck at home?
Yeah, it looks like the person who wrote it didn't know about strncmp. Truly we are lost as a species if this is the quality of the code that caused the West to be put under indefinite house arrest.

It looks like you could do something like this

C:
int CLP[MAX_CLP];

if ( (strlen(argv[i][1]) >= 6) && !strncmp( &argv[i][1], "CLP", 3 ) && isdigit(argv[4]) && argv[i][5]==':')
    {
    int index=argv[i][4]-'1';
    if (index>=0 && index<MAX_CLP)
        sscanf ( &argv[i][6], "%lf", &CLP[index] );
    }
Of course, you're better off using getopt because that code is horrible and probably unsafe.

This should scare you because at least now, we know the models and logic are shit, but in the future, when machine learning is used for decision making, the computers will tell us to hide in our houses and no one will be able to understand why or validate the results.
It's even worse than that. The media know that drama equals views so they'll publicize the most dramatic model as The Science and paint anyone who criticizes it as Evil Deniers and then demand that the politicians make the biggest economic sacrifice possible in order to stop the catastrophe. This is what's been happening with climate change for the past 20 years.

Also, this got me viewing Freeman Dyson videos since he's a noted skeptic of the effect that computer models have had on climate policy.


 
Last edited:

Yotsubaaa

Reminder: Discord is gay.
True & Honest Fan
kiwifarms.net
Am I reading this right? argv is an array of C-style strings which they are steadily walking through character by character within the if conditionals? That's why I'm stuck at home?
@Gustav Schuchardt's right, but also I was making fun of the pathetic code duplication.
eww.png


Highlighted: literally the only parts of that gross else-if structure that change between each clause. It's suggestive of a programmer who either: (1) doesn't actually understand the language or code/data structures they're using, or; (b) just copy-pasted a lot of their code together until they got something that would compile. Neither of which is a programmer you'd want in charge of a scientific model that's being cited to dictate policy.
 

Gustav Schuchardt

Trans exclusionary radical feminazi.
True & Honest Fan
kiwifarms.net
Highlighted: literally the only parts of that gross else-if structure that change between each clause. It's suggestive of a programmer who either: (1) doesn't actually understand the language or code/data structures they're using, or; (b) just copy-pasted a lot of their code together until they got something that would compile. Neither of which is a programmer you'd want in charge of a scientific model that's being cited to dictate policy.
Academics tend to be terrible programmers because they publish the results of their code, not the code itself and they regard coding as being a bit of a menial task which is below them so they don't have a sense of craft about it. In fact if you talk to self hating academics they complain that most academics don't have a sense of craft about anything.

When I was out shopping, in my fucking gas mask and gloves, I heard someone on a podcast complaining about Ferguson.

https://kiwifarms.net/threads/wuhan-coronavirus-megathread.65421/page-1532#post-6382608

Discussion around 58 minutes in.

"We have a particularly insidious form of Scientism where we not only trust science as if it were God but we trust the output of software as if it were science." at around 1h08
 

SmokingPig

Depression is hell of a drug...
kiwifarms.net
Damn right it wouldn't pass code review. This is some Yanderedev shit:
View attachment 1280583
I guess this highly paid government pro coder never heard of switch case syntax anymore. Talk about adding unnecessary redundancy, I haven't seen the whole doc; But if this is truly the syntax, then that's just bad. I code in C quite a bit, and I'll have to say this is just poor taste.
 

figbatdigger

kiwifarms.net
Smarter people have solved argument parsing and made it available for masses. In C you have getopt, in Python you have argparse, and in C++ there is also a few but their names allude me.

IMO you should take scientists who do their own coding with a fucking bag of salt. You really need an independent developer to do the implementation and scrutinize your methodology.
 

dreamworks face

Model bugman
True & Honest Fan
kiwifarms.net
So the lesson that can be learned from this thread is never trust scientists when it comes to data and statistics because the majority of them can't code for shit.
It's one thing to not know how to code because you never have tried to code. The problem with this code is that it's a sign of someone who isn't introspective - a lot of what distinguishes a professional developer from a hobbyist code is that the professional will produce code that is simpler to reason about and maintain, and it will be structured in a way that is relatively easy to reason about. I can't imagine a truly intelligent person who would just keep on trucking and churn out something like this - just staying at this level of proficiency but still "finishing" the project is a sign of mental illness. This is not saying that people who don't know how to code aren't smart people, just that anyone who was willing to do this much coding and produce so much bad code without introspecting or wondering if there is a better way would be better off in a goddamn mental institution, not telling our leaders what to do.
 

Pampered Degenerate

Smol but fierce
kiwifarms.net
My understanding (which might well be wrong) is that Ferguson's group has a "general purpose" code for modeling pandemics, that has been developed over many years, and it is that code which has been used for the covid-19 predictions. I would expect it to have been worked on by numerous PhD students and postdoctoral researchers on temporary contracts under great pressure to publish or perish, with little to no formal coding education, who saw the coding as a means to an end, and probably didn't know how to test it properly even if they cared to do so. It does not surprise me in the least that it is by all accounts a steaming pile of shit.
 

Kosher Dill

Potato Chips
True & Honest Fan
kiwifarms.net
wow
I'm looking through CovidSim.cpp and:

C:
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
This is literally the example they give of why macros are bad :lol:

C:
//// soc dist
if (!P.VaryEfficaciesOverTime || !GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Relative place contact rates over time given social distancing by place type", "%lf", (void*) &P.SD_PlaceEffects_OverTime[0][0], P.Num_SD_ChangeTimes * P.PlaceTypeNum, 1, 0))
    for (int ChangeTime = 0; ChangeTime < P.Num_SD_ChangeTimes; ChangeTime++) //// by default populate to values of P.SocDistPlaceEffect
        for (int PlaceType = 0; PlaceType < P.PlaceTypeNum; PlaceType++)
            P.SD_PlaceEffects_OverTime[ChangeTime][PlaceType] = P.SocDistPlaceEffect[PlaceType];

//// enhanced soc dist
if (!P.VaryEfficaciesOverTime || !GetInputParameter2(ParamFile_dat, PreParamFile_dat, "Relative place contact rates over time given enhanced social distancing by place type", "%lf", (void*) &P.Enhanced_SD_PlaceEffects_OverTime[0][0], P.Num_SD_ChangeTimes * P.PlaceTypeNum, 1, 0))
    for (int ChangeTime = 0; ChangeTime < P.Num_SD_ChangeTimes; ChangeTime++) //// by default populate to values of P.EnhancedSocDistPlaceEffect
        for (int PlaceType = 0; PlaceType < P.PlaceTypeNum; PlaceType++)
            P.Enhanced_SD_PlaceEffects_OverTime[ChangeTime][PlaceType] = P.EnhancedSocDistPlaceEffect[PlaceType];
There's endless amounts of this kind of copy-pasted code, just hand-written array copies or very simple things like "multiply by a constant". C'mon, if you're not going to use any C++ features to encapsulate this in a class method or something, at least write a "do X to all array slots" function that takes a pointer.

C:
int GetXMLNode(FILE* dat, const char* NodeName, const char* ParentName, char* Value, int ResetFilePos)
For the love of God, they're parsing XML by hand, on disk by scanning through the file with C-style I/O. Why?!
Note the lack of any sort of stack here - if you ever happened to have a tag with the same name inside of your targeted tag this would break.

C:
    if (P.DoUTM_coords)
    {
        for (i = 0; i <= 1000; i++)
        {
            asin2sqx[i] = asin(sqrt(((double)(i)) / 1000));
            asin2sqx[i] = asin2sqx[i] * asin2sqx[i];
        }
        for (t = 0; t <= 360; t++)
        {
            sinx[(int)t] = sin(PI * t / 180);
            cosx[(int)t] = cos(PI * t / 180);
        }
    }
This little bit of premature optimization just tickled me - let's precalculate some trig tables for degree values!
EDIT: Oh wow, I just noticed that t is a double here! That's right, just step it like it's an int one-by-one, I see no problem with that :lol:

C:
char buf[65536], txt[65536];
I was vaguely surprised that this is allowed - since when can you allocate that much on the stack?

Also, check out the RNG library for some vintage 1980s C code - even including gotos!

Looking forward to seeing everyone's favorite nonsense out of here.
 
Last edited:

Overly Serious

kiwifarms.net
How much of an issue is it that the results are "stochastic"? Monte Carlo simulations are valid and stochastic, aren't they? I understand (possibly incorrectly) that the idea is that you carry out sufficient iterations that you get a reliable average with some sort of confidence interval. Now the fact that the results vary by CPU type is pretty worrying but in principle isn't this approach valid?

The code itself looks really bad, though. And this is the cleaned up version.
 

Kosher Dill

Potato Chips
True & Honest Fan
kiwifarms.net
How much of an issue is it that the results are "stochastic"? Monte Carlo simulations are valid and stochastic, aren't they?
Yeah, there's nothing wrong with that per se. The issue seems to be that the team writing this code doesn't know the difference between good randomness (the kind you intentionally build in) and bad randomness (the kind that comes from your garbage code being buggy and completely insane).
 

MrBlueSocks

kiwifarms.net
How much of an issue is it that the results are "stochastic"? Monte Carlo simulations are valid and stochastic, aren't they? I understand (possibly incorrectly) that the idea is that you carry out sufficient iterations that you get a reliable average with some sort of confidence interval. Now the fact that the results vary by CPU type is pretty worrying but in principle isn't this approach valid?

The code itself looks really bad, though. And this is the cleaned up version.
Not sure about this case, but generally you want known, 'repeatable' randomness, even for your Monte Carlos . I.e. use a pseudo random number generator with a known seed, so that the run can be done again identically. You then do your 10,000s of runs to smooth out the averages, but the sequence of seeds is known. We're not trying to do cryptography.


What surprises me (actually it doesn't, that's a lie, let's say disappoints) is that they chose to do all this in C/C++ when they clearly have no skill or interest in doing a tight coding job . Other tools are available...

We have this problem of non-coding experts and engineers producing 'code' at work and it is mitigated to a large extent by them using Matlab , not C . Matlab suits their mathematically thinking and training, and prevents a lot of the basic bugs that otherwise you have to defensively code for. It does a lot of handholding behind the scene. Does Imperial not have a Matlab license?
There's still a problem that this produces inefficient code , so if it's needed for production generally it's documented up formally and re-implemented by Software Engineers in C++ . Where we can also add boundary & input checks / other industrialisation stuff. But that's not an issue here.

This is self taught bearded bloke in a scruffy office knocking up shit tier.

Is it really true that it was one 15000 line file? Ha. I have seen that once years ago, on a short term contract to "add some changes to our working code" . The code base was one single visual C++ class called "Functionality" . It had a main method called doit() . I got it down to 5000 lines after a week of hand refactoring out the duplications before I could add in the undocumented wish list of new features. Interestingly this was also a place that had no regard for the importance of code quality to their product, as the business had grown up before software existed, and only respected their core knowledge.
 
Tags
None