Rengo status

I thought it might’ve been something like you had to be one of the first players on your team to be able to start a review, but actually I’m not really sure how it currently works and who can start a review.

In the meantime I’ve started a review on that game for you anyway :slight_smile: (I guess it won’t be the exact same - not sure interactive review would work either)

1 Like

Thanks! Maybe i should pester anoek some more about expanding those ai reviews for regular supporters too xD

Still cannot kick on post-game ai analysis on a rengo game, but this time it doesnt even prompt me to become site supporter like it did previously regulars strict rengo

Low-priority request, but hopefully uncontroversial:

The feature that clicking on any game-branch move displays a popup for who’s played it is neat, but the next click needs to close the popup AND select the item that was clicked on (i. e. another move, or a tool in the toolbox). I feel like I shouldn’t have to click twice to select the next item after clicking on a game move. :slight_smile:

1 Like

That sounds sensible. Embarrasingly, I don’t recall making a dismissable popup for that, so I’ll have to go see what’s going on!

As ever, a screenshot (or even video) would be more helpful than you perhaps imagine … you’re intimately familiar with it, wheras for me it was “ages ago” :smiley:

2 Likes

@GreenAsJade Same player resigned twice? Game in question, stone removal also failed to pick up any dead stones https://online-go.com/game/43101743

1 Like

Two more games where i’m unable to launch the ai analysis, could some mod help out a bit?

Also a case of stone removal not picking up any dead stones so everything was marked as alive, i dont know if the score was accepted by anyone or was it automatically accepted once the timer ran out. Just in case you’re collecting examples of those games

Your last example is the old autoscore bug, dating to August 2020. The last scoring update greatly reduced instances of this, but in the past several months, it has been occurring more frequently again in regular and rengo games. To the best of my knowledge, no one knows the cause. I’ve been sounding the alert on this for more than two years now.

2 Likes

immagine
Auto-start failure?

Seriously, computers are so weird.

How does something work like … a million times, then out of the blue “waiting for 0 more to join”.

Can the organiser hit “start”, we all close our eyes and pretend we never saw this?? :sob:

4 Likes

Presumably there is a way for the last player to join the game without triggering the line of code that checks the number of players?

Or maybe the last two players joined the game at the same time? If Alice and Bob are already in the game and then Chen and David join simultaneously, the check ran when Chen joins is going to be unaware of David and say “nope, only Alice, Bob and Chen have joined so far, still missing one player” and the check ran when David joins is going to be unaware of Chen and say “nope, only Alice, Bob and David have joined so far, still missing one player”.

2 Likes

What if one player withdraws and then rejoins immediately.

Did you unassign players while organizing the game? I opened an issue on GitHub that describes a similar
scenario.

(It happens when the game reaches the auto start number of players while some players aren’t assigned to a team)

IIRC yes, but I’m almost sure there were three players assigned when the fourth joined.

TBH the question was mostly rhetorical :smiley: Just a silly lament :hugs:

I wasn’t expecting an actual answer :open_mouth:

That said, your suggestion certainly has legs. In theory, the reason why this should not be the explanation is that the whole operation of adding the each person to the challenge then asking how many people are in it, and deciding to start it, is wrapped in an atomic operation, so there should not be able to be two progressing “at the same time”.

details

… if you can spot the flaw, that’d be awesome…

class ChallengeJoin(views.APIView):

    # Here a user is trying to join an open rengo challenge
    @OGSAtomic
    def put(self, request, *args, **kwargs):
        if request.user.is_banned:
            return Response({"error": "Account banned"}, status=status.HTTP_403_FORBIDDEN)

        challenge = OpenChallenge.objects.filter(id=kwargs["pk"])
        if not challenge.exists():
            return Response({"error": "Challenge does not exist"}, status=status.HTTP_404_NOT_FOUND)

        challenge = challenge[0]

        if not request.user.is_moderator and challenge.challenger.is_game_blocked(request.user):
            return Response(
                {"error": _("Not allowed to accept this player's challenge")}, status=status.HTTP_403_FORBIDDEN
            )

        request_user_rank = floor(request.user.getBoundedRank())

        if challenge.min_ranking is not None and challenge.min_ranking > request_user_rank:
            return Response(
                {"error": "Your rank is too low to accept this challenge"}, status=status.HTTP_403_FORBIDDEN
            )

        if challenge.max_ranking is not None and challenge.max_ranking < request_user_rank:
            return Response(
                {"error": "Your rank is too high to accept this challenge"}, status=status.HTTP_403_FORBIDDEN
            )

        try:
            result = challenge.add_rengo_player(request.user)
        except Exception as e:
            return Response({"error": str(e)}, status=status.HTTP_400_BAD_REQUEST)

        # Dump other live game challenges from this user
        if challenge.game.time_per_move <= 3600 and challenge.game.time_per_move > 0:
            for C in OpenChallenge.objects.filter(
                challenger=request.user, game__time_per_move__lte=3600, game__time_per_move__gt=0
            ):
                C.delete()

        if (
            challenge.game.rengo_casual_mode
            and challenge.rengo_auto_start
            and (challenge.rengo_white_team.count() + challenge.rengo_black_team.count()) >= challenge.rengo_auto_start
        ):
            id = challenge.id
            game = startRengoChallenge(challenge)  # note that this closes the challenge
            if game:
                # politely return an empty rengo_participants_DTO, in case the client is looking for fields
                return Response(
                    {"challenge": id, "rengo_nominees": [], "rengo_black_team": [], "rengo_white_team": []},
                    status=status.HTTP_202_ACCEPTED,
                )
            else:
                return Response(
                    {"error": "Unexpected result when auto-starting game"}, status=status.HTTP_500_INTERNAL_SERVER_ERROR
                )

        return Response(rengo_participants_DTO(challenge), status=status.HTTP_202_ACCEPTED)

OGSAtomic is a thin wrapper around the django Atomic class:

    """
    Guarantee the atomic execution of a given block.

    An instance can be used either as a decorator or as a context manager.

    When it's used as a decorator, __call__ wraps the execution of the
    decorated function in the instance itself, used as a context manager.

    When it's used as a context manager, __enter__ creates a transaction or a
    savepoint, depending on whether a transaction is already in progress, and
    __exit__ commits the transaction or releases the savepoint on normal exit,
    and rolls back the transaction or to the savepoint on exceptions.

    It's possible to disable the creation of savepoints if the goal is to
    ensure that some code runs within a transaction without creating overhead.

    A stack of savepoints identifiers is maintained as an attribute of the
    connection. None denotes the absence of a savepoint.

    This allows reentrancy even if the same AtomicWrapper is reused. For
    example, it's possible to define `oa = atomic('other')` and use `@oa` or
    `with oa:` multiple times.

    Since database connections are thread-local, this is thread-safe.

I’m totally open to debugging help … keep the thoughts flowing!

2 Likes

Hello! I can’t find rengo players in real time :frowning:

I repeat what I said before. How about listing the Rengo live alongside the normal live matches? And not below correspondence games (normal matches)
It seems to me that nobody goes down to see if there are Rengo games available (since, of course, there are almost never available…)

Thank you!

3 Likes

On a somewhat related note, I actually did have a great “ad hoc” match recently, but @Alter_and_Go put in the effort to DM me :slight_smile: I would not have found the match otherwise.

1 Like

Try this group
Live Rengo Enthusiasts

It’s not very active right now but if you leave a message in the chat like “rengo tomorrow hh:mm UTC” perhaps people will join.

3 Likes

Even if it likely won’t change much to the lack of live rengo games, I do think it would make sense to have it listed next to regular live games though.

2 Likes

I’m open to suggestions, but not clear how to do this.

What would “alongside” look like?

What would it looks like on the phone?

How would we deal with people who want correspondence normal games to be less scrolling?

Are we thinking of adding a button to the cockpit (or even on the list maybe) saying “put these at the top, I’m keen to know about live rengo”?