Ah, I see what you mean now. I believe that’s not the case, at least for my use case / inspiration for this problem.
w, as read from the chain by summing real blocks’ \lfloor 2^{256} / (\text{target}+1)\rfloor, is (a good approximation of) the actual work performed by miners. The fact that difficulty adjustments are slightly biased isn’t relevant here. The difficulties are lower than “intended” perhaps, but the amount of work performed was also lower, per block, and compensated for by creating more blocks. An attacker creating their chain also needs to perform work (very close to) their chain’s cumulative work, computed by the same formula. Thus, comparing the attacker’s total chain work to the honest chain’s total chain work is fair.
Even more practically, the motivation for investigating this was how the adoption of BIP-54 (if deployed, activated, and eventually buried) would affect the headers presync DoS protection logic. In that context, we have a minchainwork variable, which is the larger of a hardcoded value in the software (“we know a chain with at least this much work exists”) and the best known chain’s total chainwork so far. The DoS protection is intended to prevent downloading and filling disk with low-difficulty spam headers that never amount to a full chain. If a peer can provide a chain that meets minchainwork, they’re not an attacker, because they have a legitimate PoW-rich chain we are interested in. Thus, attackers are limited to chains with work \leq w = \text{minchainwork}, and to abide by our time rules (timestamps < t), and we would like to bound how large such chains can get. Right now, that logic assumes 6 t because that’s what’s possible with the MTP rule. With the BIP-54 timewarp fix rules in place, and I was curious in knowing how much. It turns out the answer is drastically, and the maximum chain length would become just a bit longer than the actual chain.