The Pacific War had a number of naval battles where relatively small events led to disaster for the United States, Commonwealth, and the Japanese alike. For example, the USN's carriers survived Pearl Harbor by virtue of being out of port, and the Japanese lost at Midway due to superior American intelligence gathering and the luck of striking the IJN's carriers while they were arming and fueling aircraft. A scenario where the IJN is able to keep the USN at bay for a significant period of time, perhaps even have it on the run, is certainly possible given a bit more aggression and luck on Japan's part.
My question is what would happen if a few minor things had gone in Japan's favor, such that several years into the war the Commonwealth and United States both had a lot of their territory captured and no bases within range of striking the Japanese mainland with strategic bombers. The IJN is able to complete its ambitious naval building program, with Super Yamatos and carriers in service, and the United States still completes the atomic bomb but is unable to strike Japan with it.
What does the peace from this war ultimately look like? After the collapse of Germany there was significant opposition to diverting forces to the Pacific and a general pressure to bring the war to an end as soon as possible, on America's terms. However, in this stalemated timeline would the United States and Commonwealth consider signing a peace agreement with Japan in order to bring the war to an end? Would the Japanese Empire be able to survive by giving back Commonwealth and American territories, or would they be forced to concede all territories, even Indochina and Indonesia?