The final desirable flow turns out to be: d[1][1] -> row_total[1], col_total[1] -> d[1][2], d[2][1] -> d[2][2] -> the remaining totals
Phew! This may well be the only possible way that works, modulo symmetry.
I've tested manually that: the generated grids are always consistent row 2 and column 2 are never more than 10 row 2 and column 2 do go to 10 sometimes
W6GWGUDFL3HM6JXA23OZ6NFN4T2Q53KPNNVJ2ZCKS3AQAISTJKWAC