hash collisions

Discussion of chess software programming and technical issues.

Moderator: Ras

chrisw
Posts: 4624
Joined: Tue Apr 03, 2012 4:28 pm
Location: Midi-Pyrénées
Full name: Christopher Whittington

Re: hash collisions

Post by chrisw »

bob wrote: Fri Feb 21, 2020 11:53 pm
chrisw wrote: Fri Feb 21, 2020 10:44 pm
bob wrote: Fri Feb 21, 2020 9:38 pm
Rebel wrote: Fri Feb 21, 2020 8:46 am It's all about the demand.

Compilers can't afford to produce buggy executables.

Financial programs can't afford flawed numbers.

NASA can't afford buggy software when they launch people into space.

Boeing can't afford buggy software and sometimes it happens anyway with devastating results.

Does bug free software exist? Of course. Because that's the demand. But not after tireless testing.

Bug-free chess programs is not a good example because there is no demand. Nobody gets hurt by a bug.
Let's take a few of those.

I had a couple of students that worked at Nasa. On the first space shuttle launch, they got down almost to liftoff but could not get the main pumps to turn on to "light the fire". The problem turned out to be a parallel program. Four separate computers had to initialize, run their sanity checks, and then the results were compared and had to match. They had matched thousands of times in testing. On the day of the first launch. They did not. And they would not through several resets. They found the bug, but it took some time. And if you know NASA, it had been tested almost exhaustively before "showtime". On Apollo 11, the flight control computer on the LEM crashed repeatedly during the descent to the moon. Neil Armstrong had the daunting task of landing with no nav computer data to help. Fortunately, he was up to the task. So NASA could not produce bug-free code.

GCC has produced buggy code many times. As has Apple's CLANG, as has microsoft's visual C++. There are plenty of publicly available bug reports for all three. I found/fixed some in gcc when I started to use long long.

My local bank, very large chain, had a software bug that hid certain transactions from the end user. They found/fixed it. There have been a few of those with credit cards, etc. Three weeks ago, my wife stopped by the bank to withdraw cash from the ATM. Thing took her card, processed the transaction, gave her a receipt and her card back. No cash. She checked the account from her phone and it showed the money had been withdrawn. She went inside, after a couple of hours where they went out and counted the cash in the machine, they verified their total was off by the amount of her withdrawal and it was fixed. No bugs?

We all know about Boeing here of late. They have found bug after bug after bug in their 737 max software. Which DID cause a crash. Which killed over 300 people. No bugs? Same in the US F35 fighter jet. Hardly a good example you chose here.

This discussion has been about the claim that bug-free complex code is doable within reasonable time-frame (IE maybe 1 month to 5 years, not 5000 years). It doesn't matter how the bug will affect end users. IE I would hope that heart pacemakers are thoroughly tested. Since they use computers, bluetooth, etc. Fortunately the code is actually small enough that it can be tested enough to be ALMOST 100% safe. That chess programs don't cause anybody to be hurt doesn't matter. The people that use it for analysis might disagree if the program gives them a bad move in a correspondence game and they lose because of it.

So again, all of your examples are bad because all are incorrect due to the examples given above. So back to square one. You keep claiming compilers are 100% correct. As someone who has worked on them many times, that is not just wrong, it is incredibly wrote. Bugzilla might open your eyes.
Those anecdotes prove nothing. One anecdote about your wife at an ATM doesn’t scale to all financial software products. Maybe there was a paper jam. Maybe the bank staff thought it better not to have an argument, so they shelled out. I got shelled out once by my bank when I told them my cash withdrawal was 20 GBP down, they didn’t count anything, they just okay, we believe you and gave me 20.
Banks actually seem pretty robust, clearly there are risks in the operations of capital markets, and risk is built in to fractional reserve banking, but adding up all the electrons seems the least of their problems.
Appeals to authority don’t prove anything either. Authority is often wrong, and step progress wouldn’t be possible if authority was always right, as showed Einstein and Newton before him, just for starters.
What you haven’t done is demonstrate chess engines have crossed over into a level of complexity where there will always be bugs. Squaring the number of if statements or whatever it was and generating some large number was smacks of desperation, I have to say. Chess is a small bounded system with fixed rules. You can test everything, you can do. Didn’t think I’ld be teaching an American about can do.
Again you miss the point. Someone says "there is no example of this... (whatever this is)." ALL it takes is one example where it does exist to make that statement false. I gave an example of a serious failure for every specific software package he mentioned. Hence NONE of the examples were valid, because ALL of them had exhibited failures.
I guess we need to query your ability to add up integers and perform simple logic.
That your wife anecdotally had a problem at an ATM of Great Western Alabama bank (which may well not even have been a software problem as already noted) has no bearing at all on the status of the software at California National Bank, let alone any of the other hundred banks dotted atound elsewhere. Let’s put it another way, one egocentric chess programmer who runs around telling everybody how right he is about everything doesn’t mean all the other chess programmers are either egocentric or running around waving righteousness flags. Does it?
How many banks have had their systems hacked, account numbers and credit card numbers copied? Isn't writing software that doesn't provide the level of security claimed a software bug? Certainly seems so to me.
Chess engines are not banks. The level of complexity does not compare. And banks are astonishingly robust at adding up electrons and shuffling them around, btw.

Why is it always MY responsibility to prove something I claim
Oh, you poor lambkins. Such a tough life.
when YOU provide zero proof of any kind? In the case of Crafty, with 2^543 possible paths through the main engine, I would certainly claim THAT can not be adequately tested.
your engine is modular. Did you write functions that are not self contained and can cause damage to other modules, or did you make each module safe under all circumstances?
Is your move generator unreliable or are you 100% okay with it? I’m 100% okay with mine, I would guarantee that given a verified board it would only ever produce the full list of pseudo legal moves and not trash any other external objects. I’ll put 50,000 GBP on it, want to take the counter risk? Rhetorical question, of course you wouldn’t, you’ld be placing the bet on your own move generator. That’s one module, there aren’t many more. Care to challenge on another module? Make move and unmake move? Recursive search? Evaluation function? You can’t guarantee each of those under all board state conditions? That would be bizarre.

All your modules are guaranteed, you put them all together with recursive search, there’s some stuff to cover in hash and threading but nothing that can’t be dealt with. You already know what can go wrong.

Where’s the problem? Let’s hear some Can Do from you.


Software engineering 101. BTW that is not "squaring the number of if statements." This is simple math. If you have one if, there are two paths, one with c1 true and one with c1 false. If you have two if statements, you have 4 possibilities. c1 is false and c2 is false, then c1 is false, c2 is true... obviously 2 ^ number of if statements. And again, this is something discussed in ANY software engineering book. So how is quoting a specific and well-known number "desperation?" If we were discussing the area of a circle, would mentioning Pi be desperation? That statement makes absolutely zero sense.

BTW you are not "teaching an american about can-do." BTW you just had a software failure over there. Look up Heathrow software glitch for details.
Over where? Wrong country. Look up a map. Chess engines are not airport software systems.
NO software is immune to bugs. None at all.
You really can’t guarantee your own pseudo move generator? Bizarre.

Finally "anecdote": a short amusing or interesting story about a real incident or person.
do you really have to go looking simple words up in dictionaries? Anyway, you got the wrong meaning of word as used. never mind.

The things I quoted were ALL "real events" although I doubt any victim families of the boeing software glitch would find any of this amusing.
desperate.

This is a simple concept. To prove something exists only requires ONE example that shows that. No more.
the wife anecdote does not travel to all other banks. You would need many wives each with a different bank account.
To prove something doesn't exist requires that ALL possible things are examined and no example is found.
To prove something does exist you need to find it. Same argument. I’m waiting for your pseudo move generator to fall over, but I think you tested it okay already.

A BIG difference in effort. Hence that testing finds bugs, but says nothing about their absence.
chess engine sub-structure can be guaranteed. So can the search algorithm (which basically repeats the same things over and over at each node).

Where’s your problem?

Is this REALLY that hard to understand. If the two of you give examples, that I can easily refute,
the anecdotal wife story proves nothing about any other bank software, it may well prove nothing about your wife’s bank software either. You refuted nothing, other than maybe your unlimited belief in your own brilliance.

am I the one that is at fault? It certainly seems so.
hahahahaha!! You really want an answer to that one?

I gave a formula E = 2 ^ number of if statements. I don't have any particular number about the lower bound on E that guarantees no bugs. But it would not be a very large number. Just 32 if-tests gives 4 billion possible paths. 4 billion is not doable for testing cases.
only that a nonsense piece of maths because your engine broken down into manageable and non interfering sub units, all of which are easy to guarantee.

You are hopelessly over-invested into bigging up the complexity of chess engines and chess programming and subsequently engage from hopelessly biased argumentation positions. It gets pretty tedious telling you two and two makes four when you tell me that’s impossible to prove because the fp processor needs a billion transistors to get 4 and it can’t always be guaranteed that a neutrino won’t strike.

Anyway, feel free to be wronger. have a nice day.


The last SE book I used gave a pretty interesting example. IBM used Rational Rose (software development environment) to develop a software program that had an amazingly low number of bugs detected after distribution to end users. And they had stacked the deck by looking at ALL IBM employees and choosing the best of the best to work on the project. So the very best programmers, using a high quality software development environment, could NOT produce a bug-free program. If they could not, who could? The programmers you were using? :) Please. If there were no bugs in chess programs, all we would see would be version 10, then version 11, etc. No 10.1, 10.1.1, 10.1.2. On my apple watch we are up to 6.1.3, on my iPhone, we are up to version 13.3.1, on my MacBook, we are up to MacOS version 10.15.3. The very idea of no bugs is refuted by evidence every where you look. Just because software doesn't crash does not mean it has no bugs. Just because it doesn't produce an illegal move doesn't mean it has no bugs. Only one thing will prove the absence of bugs, complete testing of all paths with all possible data values. Computationally intractable and getting worse each year as software progresses. And even software reuse, partially the result of object oriented programming has produced its own set of amusing quotes by famous people. "For software reuse to work, the software must be usable first." I've given up on that idea. I still occasionally find a glitch in the C library, which is a sort of old version of reuse. I don't want to inhered bugs in code that I didn't write because those bugs are much harder to find and fix if I don't understand the code I didn't write.

Need I say more? Ed gives examples, I give each example of his a refutation that anyone can confirm. I gave you a formula for path testing which is getting closer to eliminating all bugs. You want some magic number N which says software below N can be bug free, software above N is not. Not exactly easy to define "n" and nobody has tried. We could probably test 4 billion test sets realistically. That will cover a program with just 32 if statements. That doesn't sound very realistic. Just my Search() code has 84 if statements. 2^84 is not possible. Evaluate() has almost 200 if statements. 2^200 is way out there.

A single day has 86,400 seconds. A year has about 32M seconds. 64 if conditions gives basically 10^19 pathways. doing 1 test per second would take 576 billion years. 1000 tests per second cuts that to 576 million years. one test per microsecond cuts that to 576 thousand years. And this is just for 64 if statements. So, how many if statements does it take for you to say "this is complex code?" 64? sounds pretty simple to me, but from the above, completely impossible to exhaustively test to prove the absence of bugs. To get reasonable time, the number of if statements probably needs to drop down to 32 or so which gives us 4 billion test cases which is doable. I am not going to try to pick a number N here because it seems completely irrelevant. Anything > 32 is computational challenging. Anything > 64 is computationally intractable. Anything > 128 is computationally impossible for all time.

All you have on your side is a feeling. On my side I have thousands of people that understand software development / engineering that are saying bug-free is only a concept that will never be reached. Backed up by billions of lines of code with plenty of bugs. A commonly used number is that there is one bug for every 1K lines of code in RELEASED software. IE it has already been tested to death. And the fly in that ointment is that is the DETECTED number of bugs, not the actual total. A serious problem exists. And it can't be waved away with "a foreign manager that waved his hands and eliminated all bugs."
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: hash collisions

Post by bob »

Why is this such a moving target discussion. We go from "chess program" to "move generator". I actually have 4 move generators. Generate captures, generate non-captures, generate checks and generate check evasions (this is a legal move generator). There are a total of 45 if() tests in all 4 combined. That is less then 10% of the 543 in the actual "engine" part of Crafty. Do I consider the move generator 100% bug-free? Probably not. Generating checks and escaping checks (efficiently) are both a little complicated as opposed to just generating everything and then screening away the moves that are not wanted. I have certainly tested it to death, several times, since I went through multiple versions of bit board logic. BUT, that has very little to do with the whole program. I'm pretty sure the SEE code works, but it COULD have a bug I am not aware of, caused by some odd combination of pieces. So _I_ am realistic enough to not be 100% sure without proving it. You seem to assume 100% bug-free after a modicum of testing.

Now, back to banks, since you didn't read. We encountered a for sure software problem with online statements. One of our credit card numbers was captured by a hacker (a few million in fact). We have found a bogus charge a couple of times where the CC company could not tell us where it came from, what it was for, or anything. If you would just use google, you could have found these:

4 days ago - TSB Bank. Millions of TSB customers were locked out of their accounts after an IT upgrade led to an online banking outage. A planned system upgrade was expected to shut internet and mobile banking services down for one weekend in April 2018, but ended up causing months of disruption.

Royal Bank of Scotland’s CA-7 batch process scheduler froze locking customers out of accounts for weeks.

Here's a good news story: Why do UK banks suffer more software failures than those in other countries? I can only guess this is caused by those companies believing they have produced 100% bug-free code? :)

For example in the last couple of weeks customers of TSB, HSBC, Barclays, RBS and NatWest suffered problems connecting to digital services.

In January 2016, HSBC suffered a major IT outage, and millions of bank customers were unable to access online accounts. The bank took almost 2 days to recover and get back to normal functioning.

In August 2015, HSBC failed to process about 275,000 individual payments that left many people without pay before a long Bank Holiday weekend. This occurred due to a major failure with the bank’s electronic payment system for its business banking users, affecting the individual payments. Bacs, a payment system used for payment processes across the UK, later picked up on this issue, labelling it as an ‘isolated issue’.

About 6 lakh payments failed to get through the accounts of RBS overnight in June 2015, which included wages and benefits. Bank’s chief admin officer stated it as a technology fault and there was no further detail on the real cause. In 2012, about 6.5 million RBS customers had to face an outage caused due to a batch scheduling software glitch, where the bank was fined £56 million.

Need I post more? Your stupid comment about an alabama bank? Just a stupid comment. Use google. The old "put brain in gear before putting mouth in motion" is good advice. You could have saved yourself having to look at all the above, with a little effort. There are MANY more. One article listed 37 bank software failures. _37_. Sound like 100% bug free? :)

Next, for that "egocentric" nonsense. I would turn that around: one egocentric chess programmer that talks about developing 100% bug-free code does not mean anybody ELSE buys into that nonsense.

For your module comment... you DO realize that modules have to share the chess board, various board state value like en passant, castle status, 50 move counter, move list (since they are generated in one module, and made in another, and unmade in another. Need I go on? One probably COULD write a chess program with absolutely no data coupling, but it would be VERY inefficient. My modules are as bug-free as I can make them. I am just wise enough to realize that that limit is NOT 100% bug-free. And when there are interactions between modules, it gets much more complicated.

I didn't mention "country" regarding Heathrow. I have flown in and out a few times. I said "over there" which you AND heathrow are from my perspective. That ought to be pretty obvious.

As far as your "wife anecdote does not travel to other banks" you should look again. I gave some HUGE bank examples up above. Over there AND over here in the US.

This logic is remarkable: "To prove something does exist you need to find it. Same argument. I’m waiting for your pseudo move generator to fall over, but I think you tested it okay already." I (nor anyone else) can test to prove a bug exists somewhere. We can test and pick out some bugs. We can't test and pick out all bugs. That is the point of this discussion. BTW, probability 101. You can form a hypothesis and say it is true with probability P, and false with probability 1-P. Since it is _impossible_ to prove the absence of a bug, it is, obviously _impossible_ to prove the presence of a bug. About the only option would be to test forever. Because to prove the presence, you have to try every single case until you get a positive. To prove the absence, you have to try every single case period. Neither is computationally tractable.

You don't like my path coverage number? How about JUST taking Evaluate()? 145 if tests. I'll let you figure out what 2^145 is in terms of paths that needs to be exhaustively executed.

If only you would say "2+2=4" we would be done here. But you are saying something else. The software engineering gurus are saying 2+2=4. You are saying 2+2=orange or something.

The "non-interfering sub-units" is a crock. A chess board is a common junction point for most of the chess engine. Many modules can change or use it. As they change/use other data structures. And then there is parallel search + race conditions. And the hash table. You go write your bug-free code. And when it eventually fails, you can always say "I didn't write that so MY code is bug free."
User avatar
Rebel
Posts: 7307
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: hash collisions

Post by Rebel »

bob wrote: Sat Feb 22, 2020 12:08 am
Rebel wrote: Fri Feb 21, 2020 11:04 pm 1. Waving with your credentials among your peers is comparable with Neil deGrasse Tyson (to name a someone) doing so in the presence of giants like Richard Dawkins, Lawrence Krauss etc. Pointless and patronizing.

2. Unless I misunderstand, you pretend it's impossible to write 100% bug free code. I think you are wrong.

3. The compiler I use has a few glitches in the interface, it never produced faulty code (executables).

1) I am not waving MY credentials.
How shall we comprehend your - I will repeat this again: "do some reading". I taught software engineering for YEARS.

It's a statement of authority to one of your peers and not the first one, someone equal in experience to yours and who had a software company with programmers on the payroll who knows everything about the bugs his programmers produced. "Do some reading" you say to your students, not to your peers.
bob wrote: Sat Feb 22, 2020 12:08 am 2) You are correct, except that (a) I don't pretend, I know because I actually read/study what software engineers discover and write about, and I believe what they say since they ALL say the same thing, and (b) it is not "I" but all of those active in software engineering that are making this claim.
And I agree with them, look at my signature how I think about my own programmer qualities. But it's not the end of the story, surely Dijkstra fixed his bugs and again, over and over. Can a nuclear power plant afford bugs? No.

Challenge for you, show me the list of bugs in the source code of Fruit 2.1
bob wrote: Sat Feb 22, 2020 12:08 am 3) so you use little of the c compiler (IE no OOP, no templates, no things like a function that calls a function that returns a pointer to a function). That is, you use the simplest parts of the compiler, which WERE probably tested pretty well, and claim that shows there are no bugs in the compiler you are using? Think about it. I don't use anywhere near all of the basic C language,
1. Exactly, testing, fixing, testing. And there are many test methodologies, I wonder, did you ever do a white or black box test (or any other similar) methodology on Crafty?

2. My first C compiler was Zortech (1991), later became Symantec and finally became DigitalMars, I still use it as my main compiler. In all those years (on one exception) it correctly did the source code checking including build-in assembler source code, correctly produced code. And it was reassuring while testing posititions to see my engine producing the same number of nodes every time when compiled with another compiler. Did the same for other engines.
bob wrote: Sat Feb 22, 2020 12:08 am yet I have encountered a number of compiler bugs where a production compiler produced a broken executable.
Sure, and then they fixed it.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
Ovyron
Posts: 4558
Joined: Tue Jul 03, 2007 4:30 am

Re: hash collisions

Post by Ovyron »

Rebel wrote: Sat Feb 22, 2020 9:14 am Challenge for you, show me the list of bugs in the source code of Fruit 2.1
Huh? All the way from this to Fruit 2.3.1 they mentioned "bug fixes" in their releases. That the list of bugs is hard to find is the fault of them for not documenting those bug fixes properly, not that their version was bug-free, or they wouldn't have needed to report that they fixed bugs when releasing new versions.
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: hash collisions

Post by hgm »

Rebel wrote: Sat Feb 22, 2020 9:14 amSure, and then they fixed it.
So bugs are not bugs if they eventually get fixed!
PK
Posts: 905
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: hash collisions

Post by PK »

Challenge for you, show me the list of bugs in the source code of Fruit 2.1
One is not yet a list, but here it comes: Fruit 2.1 thinks that castling moves from opening book are non-existent. Fix is trivial, I sent it to Toga developers forum a few years back (Toga had the same bug).
User avatar
Rebel
Posts: 7307
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: hash collisions

Post by Rebel »

hgm wrote: Sat Feb 22, 2020 3:31 pm
Rebel wrote: Sat Feb 22, 2020 9:14 amSure, and then they fixed it.
So bugs are not bugs if they eventually get fixed!
Yep, dead bugs, kill them all.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
Rebel
Posts: 7307
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: hash collisions

Post by Rebel »

PK wrote: Sat Feb 22, 2020 3:53 pm
Challenge for you, show me the list of bugs in the source code of Fruit 2.1
One is not yet a list, but here it comes: Fruit 2.1 thinks that castling moves from opening book are non-existent. Fix is trivial, I sent it to Toga developers forum a few years back (Toga had the same bug).
You are correct, I noticed the same thing during cutechess matches.

Count = 1;
90% of coding is debugging, the other 10% is writing bugs.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: hash collisions

Post by bob »

Rebel wrote: Sat Feb 22, 2020 9:14 am
bob wrote: Sat Feb 22, 2020 12:08 am
Rebel wrote: Fri Feb 21, 2020 11:04 pm 1. Waving with your credentials among your peers is comparable with Neil deGrasse Tyson (to name a someone) doing so in the presence of giants like Richard Dawkins, Lawrence Krauss etc. Pointless and patronizing.

2. Unless I misunderstand, you pretend it's impossible to write 100% bug free code. I think you are wrong.

3. The compiler I use has a few glitches in the interface, it never produced faulty code (executables).

1) I am not waving MY credentials.
How shall we comprehend your - I will repeat this again: "do some reading". I taught software engineering for YEARS.

It's a statement of authority to one of your peers and not the first one, someone equal in experience to yours and who had a software company with programmers on the payroll who knows everything about the bugs his programmers produced. "Do some reading" you say to your students, not to your peers.
bob wrote: Sat Feb 22, 2020 12:08 am 2) You are correct, except that (a) I don't pretend, I know because I actually read/study what software engineers discover and write about, and I believe what they say since they ALL say the same thing, and (b) it is not "I" but all of those active in software engineering that are making this claim.
And I agree with them, look at my signature how I think about my own programmer qualities. But it's not the end of the story, surely Dijkstra fixed his bugs and again, over and over. Can a nuclear power plant afford bugs? No.

Challenge for you, show me the list of bugs in the source code of Fruit 2.1
bob wrote: Sat Feb 22, 2020 12:08 am 3) so you use little of the c compiler (IE no OOP, no templates, no things like a function that calls a function that returns a pointer to a function). That is, you use the simplest parts of the compiler, which WERE probably tested pretty well, and claim that shows there are no bugs in the compiler you are using? Think about it. I don't use anywhere near all of the basic C language,
1. Exactly, testing, fixing, testing. And there are many test methodologies, I wonder, did you ever do a white or black box test (or any other similar) methodology on Crafty?

2. My first C compiler was Zortech (1991), later became Symantec and finally became DigitalMars, I still use it as my main compiler. In all those years (on one exception) it correctly did the source code checking including build-in assembler source code, correctly produced code. And it was reassuring while testing posititions to see my engine producing the same number of nodes every time when compiled with another compiler. Did the same for other engines.
bob wrote: Sat Feb 22, 2020 12:08 am yet I have encountered a number of compiler bugs where a production compiler produced a broken executable.
Sure, and then they fixed it.
For your last comment, :) Compilers have no bugs? But when they do find them, they fix them. But compilers have no bugs to find and fix according to you. You are absolutely mangling the English language. You said banks have no bugs. I posted several that were fairly recent. Yet that doesn't convince you that banks DO have bugs? For every example you gave, I gave multiple examples that directly contradicted the "no bugs" claim. You want ME to find bugs in Fruit 2.1? I didn't realize I worked for you. You can read the fruit documentation to see what bugs were fixed in the past.

For the white box / black box question, go back to r.g.c.c circa late 1994. You will find several LONG threads about doing this very thing, first on the bit board code. Several people assisted, made suggestions, found and reported bugs... Pretty hard to do black box testing since _I_ wrote the code and know exactly what goes on inside each module.

As far as zortech goes, I also used it. AND their "fortran to C" translator. BOTH had bugs. BTW look at ALL the versions of that compiler. Wonder why there are so many? Fixing bugs that don't exist? Eugene Nalimov (I assume you remember him) worked on the visual c++ compiler project at Microsoft (Think he was in charge of it for a while but I am not certain today that my memory is right..) He chased SEVERAL compiler issues back when I was working on Crafty and he was working on his EGTB code using Crafty as the client.

Now, you are REALLY looking silly here. First you claim compilers don't have bugs. But then you say they do but they fix them so they don't. What makes you conclude that the LAST version has no bugs if ALL the previous versions did? Once more, do some reading. Google is your friend. Look up discussions of your favorite compiler. Microsoft C++ is a good example. But the same happens with gcc, sun microsystem's C compiler. IBM's C compiler. Cray's C compiler. Never seen one reach the point where it continues to be used but no bug reports show up. They might slow to a trickle after quite a while and quite a few new versions, but I've never seen 'em stop.

So, back to your claim about compilers have NO bugs. I'd like to see you twist and turn your way out of your two contradictory statements:

(1) Compilers can't afford to produce buggy executables. also: The compiler I use has a few glitches in the interface, it never produced faulty code (executables). So apparently glitches are not bugs???

(2) Bob wrote: yet I have encountered a number of compiler bugs where a production compiler produced a broken executable. And you replied with this: Sure, and then they fixed it.

So, the compiler has no bugs, but when it does they fix it so it has no bugs? What kind of reasoning / argument is that nonsense? Compilers will ALWAYS have bugs. They will slowly get fixed over time. And new ones will also be added. And they will slowly get fixed. Repeat and rinse. It is an infinite series which never ends.

Now, for the fruit issue. First, Fabien does not list every bug that is fixed, as I do in Crafty. But I did find this:

Bug fixes
---------

Contrary to Fruit 2.0, Fruit 2.1 checks the legality of the hash-table
move before playing it. This could make Fruit 2.0 crash in rare
occasion (like once every 10000 games). This means that if Fruit 2.1
crashes, the bug is somewhere else.

Fruit 2.1 will now tolerate a hash-table resize after initialisation.
This seems especially important for use with Arena. Unfortunately, it
also raises the notorious 1MB problem of some "bug"-full interface ...


Known bugs
----------

Fruit always claims that CPU is 100% used. This is apparently a
problem in the standard C libraries on Windows. Mailbomb me if fixing
this would save lives (especially children)! I prefer waiting for
late users to throw away Windows 95/98/ME before adding an
NT/2000/XP/... solution.

And note that the 2.0 version had a couple of bugs mentioned above. I presume you want to claim he eliminated ALL remaining bugs? In just one update? That is pretty ridiculous reasoning when you look at it. And notice his comment above "that means the bug is somewhere else" so HE is not claiming this to be bug-free either. He's a bit smarter than that.

BTW didn't fruit go all the way to version 2.3.1? Ever wonder why? Certainly not fixing bugs, right? :)
chrisw
Posts: 4624
Joined: Tue Apr 03, 2012 4:28 pm
Location: Midi-Pyrénées
Full name: Christopher Whittington

Re: hash collisions

Post by chrisw »

bob wrote: Sat Feb 22, 2020 2:25 am Why is this such a moving target discussion. We go from "chess program" to "move generator". I actually have 4 move generators. Generate captures, generate non-captures, generate checks and generate check evasions (this is a legal move generator). There are a total of 45 if() tests in all 4 combined. That is less then 10% of the 543 in the actual "engine" part of Crafty. Do I consider the move generator 100% bug-free? Probably not. Generating checks and escaping checks (efficiently) are both a little complicated as opposed to just generating everything and then screening away the moves that are not wanted. I have certainly tested it to death, several times, since I went through multiple versions of bit board logic. BUT, that has very little to do with the whole program. I'm pretty sure the SEE code works, but it COULD have a bug I am not aware of, caused by some odd combination of pieces. So _I_ am realistic enough to not be 100% sure without proving it. You seem to assume 100% bug-free after a modicum of testing.

Now, back to banks, since you didn't read. We encountered a for sure software problem with online statements. One of our credit card numbers was captured by a hacker (a few million in fact). We have found a bogus charge a couple of times where the CC company could not tell us where it came from, what it was for, or anything. If you would just use google, you could have found these:

4 days ago - TSB Bank. Millions of TSB customers were locked out of their accounts after an IT upgrade led to an online banking outage. A planned system upgrade was expected to shut internet and mobile banking services down for one weekend in April 2018, but ended up causing months of disruption.

Royal Bank of Scotland’s CA-7 batch process scheduler froze locking customers out of accounts for weeks.

Here's a good news story: Why do UK banks suffer more software failures than those in other countries? I can only guess this is caused by those companies believing they have produced 100% bug-free code? :)

For example in the last couple of weeks customers of TSB, HSBC, Barclays, RBS and NatWest suffered problems connecting to digital services.

In January 2016, HSBC suffered a major IT outage, and millions of bank customers were unable to access online accounts. The bank took almost 2 days to recover and get back to normal functioning.

In August 2015, HSBC failed to process about 275,000 individual payments that left many people without pay before a long Bank Holiday weekend. This occurred due to a major failure with the bank’s electronic payment system for its business banking users, affecting the individual payments. Bacs, a payment system used for payment processes across the UK, later picked up on this issue, labelling it as an ‘isolated issue’.

About 6 lakh payments failed to get through the accounts of RBS overnight in June 2015, which included wages and benefits. Bank’s chief admin officer stated it as a technology fault and there was no further detail on the real cause. In 2012, about 6.5 million RBS customers had to face an outage caused due to a batch scheduling software glitch, where the bank was fined £56 million.

Need I post more? Your stupid comment about an alabama bank? Just a stupid comment. Use google. The old "put brain in gear before putting mouth in motion" is good advice. You could have saved yourself having to look at all the above, with a little effort. There are MANY more. One article listed 37 bank software failures. _37_. Sound like 100% bug free? :)

Next, for that "egocentric" nonsense. I would turn that around: one egocentric chess programmer that talks about developing 100% bug-free code does not mean anybody ELSE buys into that nonsense.

For your module comment... you DO realize that modules have to share the chess board, various board state value like en passant, castle status, 50 move counter, move list (since they are generated in one module, and made in another, and unmade in another. Need I go on? One probably COULD write a chess program with absolutely no data coupling, but it would be VERY inefficient. My modules are as bug-free as I can make them. I am just wise enough to realize that that limit is NOT 100% bug-free. And when there are interactions between modules, it gets much more complicated.

I didn't mention "country" regarding Heathrow. I have flown in and out a few times. I said "over there" which you AND heathrow are from my perspective. That ought to be pretty obvious.

As far as your "wife anecdote does not travel to other banks" you should look again. I gave some HUGE bank examples up above. Over there AND over here in the US.

This logic is remarkable: "To prove something does exist you need to find it. Same argument. I’m waiting for your pseudo move generator to fall over, but I think you tested it okay already." I (nor anyone else) can test to prove a bug exists somewhere. We can test and pick out some bugs. We can't test and pick out all bugs. That is the point of this discussion. BTW, probability 101. You can form a hypothesis and say it is true with probability P, and false with probability 1-P. Since it is _impossible_ to prove the absence of a bug, it is, obviously _impossible_ to prove the presence of a bug. About the only option would be to test forever. Because to prove the presence, you have to try every single case until you get a positive. To prove the absence, you have to try every single case period. Neither is computationally tractable.

You don't like my path coverage number? How about JUST taking Evaluate()? 145 if tests. I'll let you figure out what 2^145 is in terms of paths that needs to be exhaustively executed.

If only you would say "2+2=4" we would be done here. But you are saying something else. The software engineering gurus are saying 2+2=4. You are saying 2+2=orange or something.

The "non-interfering sub-units" is a crock. A chess board is a common junction point for most of the chess engine. Many modules can change or use it. As they change/use other data structures. And then there is parallel search + race conditions. And the hash table. You go write your bug-free code. And when it eventually fails, you can always say "I didn't write that so MY code is bug free."
As ever, the length of your bla-bla is in direct proportion to how wrong you are.
No amount of words, probably several thousand by now, about banks and your wife at the Alabama ATM, make the slightest bit of difference. Banks are not chess engines. Banks are big complex interconnected things with millions of users and accounts and untold numbers of things that can go wrong. Chess engines are simple things that repeats the same simple modular functions over and over and over again. If you can’t write some simple modules, guarantee they are fully tested, do what they are supposed to do, while not stomping all over objects they are not supposed to, then, you are, in the words of hgm, in the wrong buisiness (sic). All you then need do is link the modules in recursive search, handle some hash stuff (well known) and parallel stuff (also well known), test it to death, and that’s it. One 100% bug free chess engine.

Computer chess, despite your massive personal investment in bigging up its complexity, is actually quite straightforward, bounded, and progressively easier year on year, overrun with testing tools, compiler/dev systems which are flagging errors even before you finish to type the next line, compilers which pick up program error as if they were interpreters, and dev environments which trap just about any crash bug or memory bug you care to run through them. If you can’t get 100% bug free in that environment, well, what can I say? Get a post as intern someplace up to date and customer oriented for a few months.