Torch kernels in native loops, and Python allocation trimmed

Torch matrix products use AVX2 when the CPU has it, slice stores and index gradients run in native loops, short-lived tensor buffers are reclaimed by minor collections, and Python strings and instances recycle their buffers.

When the CPU has AVX2, pt_matmul multiplies four rows by eight columns at a time in four-lane registers, fusing the multiply and add only where every product is exact in an f64, so no value changes (8a602902; torch_matmul 0.72 ms instead of 0.91). Two element loops in tensor.js were 17% of the instructions a transformer training step ran: the store behind a slice assignment and the accumulation behind an index gather's gradient. Both now try a native loop first (4775d646; a 512 × 512 slice store into every other column in 0.28 ms instead of 3.5). TypedArray fill and cross-kind set store in bulk (5cc98944), x.__class__ is read natively instead of through an interpreted getattr call (d718caa9), and installed code answers its cache and JIT eligibility without a range search (fea13f06).

The collector requested a major collection for every 8 MiB of large payloads, on the belief that the nursery pretenured them. It does not: tensor buffers are born young and die young. The schedule now asks for a minor and makes every fourth one a major (ec5d4f4c), and torch_transformer at 44 steps took 1 major and 12 minors in 16.2 ms where it took 6 majors and 2 minors in 28.7. The heap also recycles a dead Python instance's attribute buffer (38d627e0; 240,000 instances make 122,381 allocations instead of 335,620) and small string buffers for the str methods' results (3ca7f378), a literal's keys borrow their site's plan instead of counting references to it (883dc185), and a method site keeps the method itself in its cache entry (b12ce570). Each change was measured against its parent, mostly a few percent at a time, with the Python suites passing.