Skip to content

Enhance CLI output formatting and logging#27

Open
SimPleased wants to merge 1 commit into
MinecraftAtHome:mainfrom
SimPleased:prettier-logging
Open

Enhance CLI output formatting and logging#27
SimPleased wants to merge 1 commit into
MinecraftAtHome:mainfrom
SimPleased:prettier-logging

Conversation

@SimPleased

Copy link
Copy Markdown

Just changes to the console output mostly to make it a little nicer to look at.
One of the big QoL changes is that the output message for when you find a new seed will also contain a link to view it on either chunkbase or mcseedmap.

@Likqez

Likqez commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

No official review, thus only gonna post a comment here:

Im not sure if adding chunkbase/seedmap links to the output will benefit anyone, i think most people never observe the line being printed after CPU eval passes, and just resort checking the output file for found seeds.

You seem to create new structs, when you could reuse the existing ones, from

COMMISSION/src/common.h

Lines 32 to 43 in 3408b3d

struct GpuOutput {
uint64_t seed;
int32_t x;
int32_t z;
};
struct CpuOutput {
uint64_t seed;
int32_t x;
int32_t z;
int32_t score;
};

If your struct is needed i believe it should be placed in the respective header file.

Same goes for your added functions. They should be specified in the respective header.

@BoySanic BoySanic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you resolve these items I think we can merge.

Comment thread src/main.cpp
#include <algorithm>
#include <random>
#include <atomic>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see why we need the extra newline

Comment thread src/main.cpp
std::optional<HostService> server;
std::optional<std::string> output_file;
std::optional<int64_t> start_seed;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here

Comment thread src/main.cpp
output_file = argv[i++];
} else if (std::strcmp("--start", arg) == 0) {
if (!parse_argument_int(argc, argv, i, start_seed, [](int64_t start_seed){ return true; }, arg)) return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Comment thread src/main.cpp

void print_banner(const Args &args, int threads, int32_t min_size, const std::string &output_path, uint64_t start_seed) {
std::printf("============================================================\n");
std::printf("Minecraft Mushroom Island Search\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably say COMMISSION with a version number instead of the generic "Minecraft Mushroom Island Search" nobody refers to this program as.

Comment thread src/main.cpp
std::printf("unbound : %s\n", unbound ? "true" : "false");
std::printf("print interval : %d\n", PRINT_INTERVAL);
std::printf("GPU devices : %s\n", join_devices(args.devices).c_str());
std::printf("finding type : %s\n", current_finding_tag().c_str());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant if you're also displaying whether it's large biomes and unbound.

Comment thread src/main.cpp

std::string current_finding_tag() {
if (unbound) {
return large_biomes ? "ULB" : "USB";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't useful, and it's wrong because what if you're running with unbound but your result is in-bounds?

Comment thread src/main.cpp

void write_result_line(std::FILE *file, const SearchResult &result) {
const std::string tag = current_finding_tag();
std::fprintf(file, "%s %" PRIi64 " %" PRIi32 " %" PRIi32 " %" PRIi32 "\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about the tag being wrong.

Comment thread src/main.cpp
}
std::printf("seed=%" PRIi64 " x=%" PRIi32 " z=%" PRIi32 " size=%" PRIi32 "\n",
r.seed, r.x, r.z, r.size);
std::printf(" Chunkbase : %s\n", make_chunkbase_url(r.seed, r.x, r.z, large_biomes).c_str());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how I feel about baking in chunkbase/mcseedmap links for this. Maybe it should be a compiler option though if you did want to still have it.

Comment thread src/main.cpp
std::printf("Hello! large_biomes = %s\nunbound: %s\nprint interval: %d\n", large_biomes ? "true" : "false", unbound ? "true" : "false", PRINT_INTERVAL);


int32_t min_size = args.min_size.value_or(6'000'000 * (large_biomes ? 16 : 1));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change the default from 10M (160M LB) to 6M (96M LB)?

Comment thread src/main.cpp
}

if (output_file != nullptr) {
std::fflush(output_file);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be the most "Correct" thing to do but since we're already closing the file anyway in the next line, I'm not sure it's necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants