Nice, looks like you tracked down part of the problem. I applied your patch and yes that particular glitch is fixed. I think we are very close to a full solution. First here are a few more test segments...
Code:
const b2Segment segment1 = {b2Vec2(-7.8907800f, 6.1776128f), b2Vec2(-3.8292155f, 105.38913f)};
const b2Segment segment2 = {b2Vec2(-7.0022640f, 5.9507990f), b2Vec2(-84.407677f, 69.667091f)};
const b2Segment segment3 = {b2Vec2(2.7193356f, 7.3012047f), b2Vec2(48.245796f, 95.472626f)};
Now if you look at those raycasts you will see that this time the lines do not intersect the AABB of the edge shape that it was probably supposed to. This stems back to the probelem of the AABBs of the edge segments not containing their end points. So a possible fix I have is to add 1 to the upper values in b2BroadPhase::ComputeBounds() ...
Code:
lowerValues[0] = (uint16)(m_quantizationFactor.x * (minVertex.x - m_worldAABB.lowerBound.x)) & (B2BROADPHASE_MAX - 1);
upperValues[0] = (uint16)(m_quantizationFactor.x * (maxVertex.x - m_worldAABB.lowerBound.x) + 1) | 1;
lowerValues[1] = (uint16)(m_quantizationFactor.y * (minVertex.y - m_worldAABB.lowerBound.y)) & (B2BROADPHASE_MAX - 1);
upperValues[1] = (uint16)(m_quantizationFactor.y * (maxVertex.y - m_worldAABB.lowerBound.y) + 1) | 1;
Just looking at the math you can see that without the 1 the lower and upper bound would not be containing the top part of the shape. This effects all shapes not just edges. So without this change you can zoom in and see that even for poly shapes and circles their AABB's does not fully contain the shape. Then again maybe that's how it is supposed to be since it is all quantized? In that case there is probably code in test segment has a similar off by 1 error.