did pre-Meiji militaries in Japan have "soldiers" and "officers" as distinct castes?

in the West we are used to having these two broad categories of military personnel, soldiers and officers. It seems that it is usual for soldiers to rise to higher “enlisted rank” in time whereas officers rise to higher “officer rank”. Instead of various other possible ways of doing it, like having separate systems of ranks for every military occupation specialty, sort of like academic degrees. Maybe this just goes back to the officer nobility vs commoner soldiers divide way back and nobody felt changing it since.

Now, the military in Japan, both of the Shogunate and of the domains, since 17th century consisted only of the samurai who presumably were each other’s social equals, broadly speaking. So how did their hierarchy work? Was it easy for a guy who started as “low rank infantry” to rise to what we would recognize as an officer billet?

I don’t know how analogous it is, but the bulk of a Japanese army consisted of ashigaru and other footsoldiers. Samurai were comparatively rare and valuable. The same occurred in medieval Europe; knights were a small part of armies. They couldn’t become elevated in the same way as the modern enlisted>(warrant)>officer path, but an occasional lord might’ve ennobled someone.

Nope - unequal. A loose feudalism of sorts persisted throughout the Edo Period and rank correlated to income. Daimyo ( lords with large incomes ), hatamoto ( “bannermen” - gentry with income sufficient to be judged capable of raising troops ) and go-kenin ( “housemen” - simple soldiers ). Promotion through the ranks by merit had been possible if difficult in wartime, but the enforced peace of the Edo and Tokugawa’s strict caste system largely eliminated that option. Officer status pretty much derived from feudal rank, even as the samurai class as a whole became increasingly impoverished as the 17th century wore on ( fixed income from the rice stipend not keeping pace with inflation and the enormous luxury expenditures demanded by social fiat ).

Wikipedia article says that under Tokugawa the ashigaru were incorporated into the samurai class with low rank or sent back to be civilian commoners. So their military was indeed composed of samurai until the Meiji began conscripting peasants, against objections such as those from the Satsuma Rebellion.