Has the PoW algorithm changed? I am in a graduate program in Software Engineering and have recreated the mining programs in Python and Ruby, as well as computing the Merkle Root, etc..

I have been randomly chosing blocks from Bitcoin to test my algo(s).  I notice that my nonce and current block hash finder works upto a certain point.  It seems that it works upto about block 400,000, circa 2015... but fails beyond this point.  Did they tweak the mining algorithms around that time?  Should there be another data point?

I have these data points:


previous hash
merkle root
difficulty
version
time in unix
nonce: (this is what the program searches for and puts out the nonce and current block hash, if found)


As I mentioned it confirms and "mines" the blocks up to about block 400,000... but fails afterwards.

Some enlightenment is appreciated.
I will take the suggestion above and post the answer for others.

As mentioned I am a noob at looking into the bitcoin and blockchain.  My interest is the programming code behind the cryptocurrencies and the various blockchain implementations.

When I was backtesting the correctness of my code, which I did in Python and Ruby, I discovered that it wasn't working at a certain point.  I wasn't sure at which block #, where it was failing until I tightened up the test and discovered it was at that block #410000.  A simple look at the data, I realized that either the mining algorithm changed slightly for difficulty or something in the inputs wasn't correct, so I isolated all the inputs and realized that it was the VERSION field that changed.

Of course, I know nothing about the different versions of the blocks, nor the forking behaviors yet... it wasn't clear until the poster provided the link that confirmed to me that the versions had changed, thus throwing off my program.  But I can easily tweek it to adapt to the version field, now that I realize it is not as hardcoded as the other fields.

One thing that I noticed, and I am not a probabilities expert, but the nonce values seem to land in the 9 or 10-digit range... so when a miner is searching for the nonce, I would assume that the miner does not need to start the search at 0.... but rather 100000000 and increment, it seems the time to calculate is reduced substantially.

My next step is I'd like to analyze the range of nonce values and see if they fall within a certain spectrum of values and where they cluster, whether 9 or 10-digit lengths. It's all just curious analysis.

My goal to all of this is the create a fully running program that pulls all of the blockchain, and dynamically confirm the blocks(merkle roots and header hashes), store the info in a csv file.  The point is for me to learn to scrape, process and analyze the results just to find any irregularities, or randomness if that's the case... just from curiousity sakes.

As a pet project, I am going to create a blockchain-distributed ledger for a friend who has a PhD in food safety and security, and see where it goes from there.