IDK. It's wierd both would occur at the same time. You're saying it idles fine and drives nice as long as you don't step on it hard, right? I guess the place to start if it were my truck ...and just like they say in the service manuals, is to start with a good visual inspection under the hood of various components, and then basic troubleshooting.
Start with the most un-obvious thing of making sure the electrical is good:
Batt connections are solid-good (redo them). I'd leave them disconnected a while (to reset the computer) while you do the other things on this list. In the meantime ensure the
engine and body grounds are good by loosening the bolts/nuts and wiggling the cables and re-tightening. And that the battery itself is good (go to a parts store and have it load-tested). There are (on my tk) major grounds under a plastic panel above the L front tire. Mine were super rusty, I bet yours could be too. They should be cleaned so you know there's good grounds. Theres also a major ground back by the tank filler neck on mine ..that were also rusty. Grounds are how the electrical path gets back to the computer. Wiggle fuses, etc. The reason is, often semi-good electrical can cause "wonky" TIPM behavior (like a drunk salior who can't think straight, lol). And therefore odd truck behavior. It's well-known that these trucks (and any modern vehicle) can act 'funny' when the electrical is compromised (I've seen it!). It just takes a short while to look at the above and cross those basic things off your list.
Remove the engine cover & hose, Inspect the throttle bore for "dirtiness" and carbon build-up. Clean if necessary with throttle body cleaner and a solvent-safe brush.
Inspect the PCV valve. Or just change it if your truck has a lot of miles on it. Also inspect the hose for cracks, etc. The reason is, when you floor it, the PCV valve spring allows the valve to open for maximum air flow. If it were 'sticking'.... ?
Please use the following link when ever using Amazon.com. Any purchases you make on Amazon will help support this channel.http://amzn.to/2mALgqSEveryone love...
www.youtube.com
Inspect the air filter. Make sure there isn't anything (like a mouse nest) in the air box.
I'd probably wiggle the TIPM wire bundle just a little ...under the fuse box. These have been known to get rusty at the pins in heavy salt areas ...but for now just wiggle them...come back to them later if nothing else does the trick.
It would be a real good idea to inspect each of the plugs and the coil packs (ohm them out). But you might wait until after a test drive for that. It might just be weird electrical. When you do, inspect the ends of each coil for cracks or spark traces. Cracks could allow the spark to be jumping which you might feel under heavy load. But if you don't want to do it just yet, then take it for a drive and see if the problem persists. Fuel pressure and vacuum would be good to know too if you have to dig into things a little deeper.
Does your scan tool allow you to get real-time readings?
.