Archived
MuseTower::declare read vision_config.num_hidden_layers and the position grid with only a positive check, then handed them to host vectors -- full.assign(depth), L.assign(depth) -- before any weight was consulted. A container stating 2^62 layers threw std::length_error (or bad_alloc just below max_size) out of the declare phase, and nothing between there and main catches: the process died with a SIGABRT and no report, where every other bad config in this file says what it dislikes on stderr and refuses with RAD_E_INVAL. The grid sides were the same story multiplied: pos_emb_height x pos_emb_width is a signed product of container values that can overflow before any comparison could see it. The gate now refuses depth past 128 and a grid side past 512, against published maxima rather than round numbers: the deepest vision encoder ever shipped is 48 layers (ViT-22B, InternViT-6B -- this family's towers are SigLIP-class, tens), and the largest stored position table a side of 92 (SigLIP at 1292 px over patch 14; CLIP 16, SAM 64; native-resolution towers store no side x side table). The caps sit ~2.6x and ~5.5x past those, so they never bite an honest container, and at the cap itself the guarded shapes are harmless: the depth vectors cost KiB and the grid products top out at 2^18, too small to wrap signed 64 before a comparison sees them. museglimmer_test pins both caps at their boundary and far past it -- the grid at both sides together, since one side alone the height==width rule refuses before the cap is consulted. Found by the 2.1.0 review pass (axis: hostile model files); caps sourced against published encoders and tightened at the operator's request, from the first pass's wide 512/4096 margins.