As described in https://bugs.freedesktop.org/show_bug.cgi?id=23403 the SYSTEMCOUNTER struct in sync extension is bugged.
It needs a global pad instead of a last-field pad.
The solution is to substitute index += buffer_pad(block_len, 4) with index += buffer_pad(index, 4) on these lines
https://github.com/bread-graphics/breadx/blob/master/src/auto/sync.rs#L88
https://github.com/bread-graphics/breadx/blob/master/src/auto/sync.rs#L104
So consequently the size method needs a rewrite too.
The bug is still open since 2009, you can be the first one implementing the protocol in the right way (except for libx11).