Algebraic topology for termination proofs I'm reading about various ways in which termination proofs of software verifiers are built: ad-hoc methods that detect recursions, term-rewriting, synthesis of lexicographic orderings...
From the ad-hoc methods I came with the following intuitive idea. Is it possible to formalize termination with algebraic topology? The idea would be:

look at termination as the problem of finding loops in the code of the program.

look these loops as a fundamental group at some origin (a point in the source code)

test whether this fundamental group is simply connected (implying that this node is terminating)


Of course both problems are undecidable (the second one being testing the simple connectedness) but it seems to me theoretically feasible.
Has this been done before? You find it is not feasible?
Resources I find interesting (feel free to add)
Progress Measures and Finite Arguments for Infinite Computations, page 3.
Power domains and predicate transformers: A topological view (if I ever get access to it)
The topology of program termination.
Scott approach distance on metric spaces
As someone somewhat familiar with termination analysis, I'd say that the techniques are only as ad-hoc as the programs they aim to prove termination of, which is to say very ad-hoc indeed.
The crucial approach to scaling such analyses is modularity which allows decomposing the problem into sub-problems. Indeed this usually consists in identifying cycle-like things, typically either cycles in the control flow graph or the call graph, and decomposing it along it's strongly connected components (SCCs). We have very efficient algorithms to do this. No algebraic topology really required here AFAIK.
This is the easy part. The hard part is then identifying variants for each SCC. Here again you can do things in a modular manner, but it's more subtle. The most relevant fields as far as I can tell are constraint solving, and in particular linear programing and general combinatorial principles often related to Ramsey theory. Again, I'm not sure whether algebraic topology really has a role to play.

I will mention a connection between algebraic topology and rewrite theory though, if that can sate your curiosity: there is a strong analogy between homological algebra and confluence of rewrite systems. In particular, there is a connection between simply connected spaces, and (nice) rewrite systems in which every critical pair is closed (which implies confluence).
Here's some nice notes by Yves Guiraud, Eric Hoffbeck, and Philippe Malbos.
And Here's some really nice slides by Gershom Bazerman. Following the links to those papers should get you somewhere.