Been kinda away from the engine for a while doing other things but I will try to give you some insight.
When I was building this part, sadly there is no easy way to calculate "what is ground / wall / ceiling" easily.
Min penetration for penalty (MPP) is how fat the colliders are. Remember this is for every collider in the game. So if you had a MPP of 1 pixel (0.01), then two object's colliders are touching if they are 2 pixels apart (even 2 colliders right next to each other are still considered touching). In order for something to be NEXT TO but not touching, you need to be 2.00001 pixels part for the objects in this case.
Imagine a box 32x32 pixels. "Behind" this box is a 32x32 pixel "deadly object." I need to be sure the guy can stand on the box without being instantly killed by the deadly object of the same size.
Here are the ingame settings for the guy.
To translate the below numbers into pixels you x100
Min penetration for penalty (MPP) - Is set in the physics 2d menu
ColliderBuffer - Is set in the actual script for the guy. Either "PlatformerCharacter2D_Pixel" or "PlatformerCharacter2D_Physics_Prechecks" at the top of the script. It will look something like.
"private float ColliderBuffer = 0.011f; // Closest distance you can get between two colliders"
The ColliderBuffer is used in the scripts to deal with when the character gets close to a solid object in order for him to move the correct shortened distance to that solid object (ie you dont want to move at the full speed when you are REALLY close to a solid object). In the example of the box and deadly object, there were times walking across such an example was fine, but when you jump and landed, the character would die due to physics, very slightly, clipping him into the deadly zone (this is how physics works and what the MPP buffer is used for).
Physics Version - "PlatformerCharacter2D_Physics_Prechecks"
Min penetration for penalty - 0.004f
ColliderBuffer - 0.011f
So, why the MPP value of 0.004f ?? Physics based movements need at least some buffer in order to calculate their physics stuff. This is the lowest tested value I was able to put it without odd things happening. So the buffer we need would be 0.004 * 2 + 0.001 = 0.009f. If you want you could change the collider buffer to that value to lessen the chance of clipping. Why the value of 0.011f, I really dont remember, but I figured it was the best after testing and I left it at that. This was tested a few Unity versions ago so you never know how things might have changed. Remember that 0.01f is actually one pixel (quite the buffer) between objects.
Feel free to mess with both the MPP and Collider buffer values (always remember what the default values are though). Also, watch what happens when you lower the MPP near 0 (the physics version will start acting odd at times). Always make sure the ColliderBuffer is at least 2xMPP + 0.0001 though.
Pixel Version - "PlatformerCharacter2D_Pixel"
Min penetration for penalty - 0.0001f
ColliderBuffer - 0.0004f
0.0001f * 2 + 0.0001 = 0.0003f (I used 0.0004 but the difference is almost nothing)
After all the explanation above you can see the pixel values are extremely small comparatively. "Physics" in this version are calculated via transforms in the script and not by Unity thus I have more control. Things are a bit more stable using this version.
You can always use the Pixel guy version for better accuracy and stability, but you will lose the ability to climb slopes. All you have to do is add the pixel version to the spawner and set the correct MPP (I believe it warns you in the editor if you didnt change the MPP value.
Finally there is one more value you can mess with in "CalculateChecks.cs"
This script deals with checking distance to solid objects (wall / ceiling / ground) and is used by any other script that needs it (even the AI).
"private float ColliderIndent = 0.009f; // The slight indent of AoE checks to prevent false positives (if needed)"
This was put into the script many Unity versions ago just in case something I needed it (this was previous to being able to change the MPP). As you can see from the comment it deals with false positives. To tell you the truth, I dont know what the "correct" value for this should even be. I am not even sure anymore what making it 0 would do. Feel free to change it to see how it effects things (values between 0.000f - 0.050f).
These are the top few things that you can mess with that would help deal with this issue.
Hopefully you understand what certain values are and how they effect the engine.
Sorry for the late reply.