Well, I guess the “rock” formed since the recent eruption of Mt St Helens isn’t...
Crystallization/bonding is all that is required per evidence. “Time” is not of the essence. Massive amounts of water dissolving calcium and or other minerals provides ample cementing.
In your example of a swamp and coal, the critical factor is depth and hence more importantly time. However, even in oxygen depleted conditions, organics don’t last eons. Unless they were buried rapidly...
Volcanic ash is a little different. Some cools in the atmosphere and comes down as ash. Some is still hot when it reaches the earth and solidifies.