If they have reasonable grounds that you may be carrying numerous items under various acts, ie stolen property, articles for going equipped, drugs, ciggies (if under 16), drugs, firearms etc etc etc, you can be detained for a search. Similar to an arrest but slightly different.
At this stage, if you do not give any details there will be no offence. If you are then arrested for something found on your person and still stay shtum, that is your right. The first thing said to you will be "You do not have to say anything".
If you are suspected to be wanted for another offence (ie a copper ecognises you, or you fit the description of a felon), then may be a chance your dna or fingerprints will be on file. These can now be tested using force even before any charge.
If ID is still so sought and you are still legally detained for a suspected offence then you have the right to stay silent throughout and there will be no additional offence. It may harm your defence, as said in the caution, but no an offence in its own right.
However, if silent at court this will be deemed contempt. If evidence is there for a conviction you will be convicted regardless and a contempt conviction thrown in.
You will serve your time as per usual.
Although PACE came in in 1984/5 many IRA terrorists used to do this and still got banged up.
Finally, I know you said in the scenario you are walking, but if you were driving or believed to have been, it is an offence in its own right not to give your details. And also uder The Prevention of Terrorism Act if that is why yoiu have stopped and some section of The Criminal Justice Act.
Hope this helps.