How to stop blender from generating duplicate vertices on export? Yes, I know, use Mesh -&gt; Clean up -&gt; remove by distance.  I did that, and in blender, it appears as if things are all fine and dandy, I made 3 cubes and made pyramids at the end, total vertex count is 18, makes sense to me.  Export object as gltf, and I get... 84 vertices...

This is the GLTF report

gltf image, and my blender:

You can see in the bottom corner, 18 verts....
And for the final touch, here's the output from my tiny_gltf loader c++ program, which outputs vertices, and says the number of vertexes and indexes.
{NORMAL: 1}
{POSITION: 0}
{TEXCOORD_0: 2}
COUNT 84
INDCOUNT 96
(1, 1, -1)
(1, 1, -1)
(1, 1, -1)
(1, 1, -1)
(1, 1, -1)
(-1, -1, 1)
(-1, -1, 1)
(-1, -1, 1)
(-1, -1, 1)
(-1, -1, 1)
(-1, -1, 1)
(3, 1, -1)
(3, 1, -1)
(3, 1, -1)
(3, 1, -1)
(3, -1, -1)
(3, -1, -1)
(3, -1, -1)
(3, -1, -1)
(3, 1, 1)
(3, 1, 1)
(3, 1, 1)
(3, 1, 1)
(3, -1, 1)
(3, -1, 1)
(3, -1, 1)
(3, -1, 1)
(1, -1, -1)
(1, -1, -1)
(1, -1, -1)
(1, -1, -1)
(1, 1, 1)
(1, 1, 1)
(1, 1, 1)
(1, 1, 1)
(1, -1, 1)
(1, -1, 1)
(1, -1, 1)
(1, -1, 1)
(1, -1, 1)
(1, -1, 1)
(4, 0, -0)
(4, 0, -0)
(4, 0, -0)
(4, 0, -0)
(-3, 1, 1)
(-3, 1, 1)
(-3, 1, 1)
(-3, 1, 1)
(-3, 1, 1)
(-3, -1, 1)
(-3, -1, 1)
(-3, -1, 1)
(-3, -1, 1)
(-3, 1, -1)
(-3, 1, -1)
(-3, 1, -1)
(-3, 1, -1)
(-3, 1, -1)
(-3, -1, -1)
(-3, -1, -1)
(-3, -1, -1)
(-3, -1, -1)
(-3, -1, -1)
(-1, 1, 1)
(-1, 1, 1)
(-1, 1, 1)
(-1, 1, 1)
(-1, 1, 1)
(-1, 1, 1)
(-1, 1, -1)
(-1, 1, -1)
(-1, 1, -1)
(-1, 1, -1)
(-1, -1, -1)
(-1, -1, -1)
(-1, -1, -1)
(-1, -1, -1)
(-1, -1, -1)
(-1, -1, -1)
(-4, 0, 3.01992e-07)
(-4, 0, 3.01992e-07)
(-4, 0, 3.01992e-07)
(-4, 0, 3.01992e-07)

Look at all those duplicates! how do I stop blender from ruining my meshes on export?
This doesn't really answer my question, but I found a temporary work around by copying the vertices on the mesh and deleting the old one.
Q: Is this just a really bad bug or something?
It is incorrect to assume the number of glTF verts will equal the number of Blender verts. Each glTF vert has a unique normal for example, while each Blender vert can have a different normal for each poly it is in. Your model uses flat shading and you can see each vertex has multiple normals.

To handle this there are &quot;duplicate&quot; glTF verts (that have the same position, but different normals). The same thing happens for all other &quot;vertex per poly&quot; data, like UVs.
&quot;Duplicate&quot; verts are inserted only when necessary, so turn off export of anything you don't need—normals, tangents, UVs, vertex colors, materials—to get a smaller glTF vert count.