Page MenuHomePhabricator

Fourth and subsequent Argument references not resolved
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
GrounderUK
Apr 2 2024, 10:08 PM
Referenced Files
F44830970: IMG_0927.png
Apr 6 2024, 1:52 PM
F44830973: IMG_0926.png
Apr 6 2024, 1:52 PM
F44552290: IMG_0923.png
Apr 4 2024, 9:43 PM
Unknown Object (File)
Apr 4 2024, 9:38 PM
F44551397: IMG_0922.png
Apr 4 2024, 9:34 PM
F44509436: IMG_0918.png
Apr 4 2024, 3:38 PM

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The function implementation evaluates to True

What should have happened instead?:
The function implementation should evaluate to False.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
If False is present in any or all of items four to eight in the list, the function implementation evaluates incorrectly to True.

The underlying function evaluates correctly with any of its three implementations. See https://www.wikifunctions.org/view/en/Z14718

Details

TitleReferenceAuthorSource BranchDest Branch
Continue eager evaluation for local keys that have already been seen.repos/abstract-wiki/wikifunctions/function-orchestrator!156apineapine-has-variablemain
Customize query in GitLab

Event Timeline

@GrounderUK , are you still seeing this behavior? When I run this function with input 1 set to True and all others set to False, I get an error.

Still worth investigating, but I want to try to reproduce your bug. If we're getting incorrect results, that might mean we have a scope attachment error in the orchestrator. Errors are probably symptomatic of something less serious.

@GrounderUK , are you still seeing this behavior?

Yes I am, I’m afraid 🤷‍♂️ You do need to Try the implementation rather than the function; other implementations succeed or time out.

IMG_0918.png (2×960 px, 384 KB)

The second test also evaluates to False (because True) rather than True (because False), for this particular implementation.

Mcastro changed the task status from Open to In Progress.Apr 4 2024, 4:38 PM
Mcastro triaged this task as Medium priority.
Mcastro moved this task from To triage to In Progress on the Abstract Wikipedia team board.

Ah! I see. I was running it with all of the Boolean argument values set.

I have no idea what the backend sees when a Boolean argument is uninitialized on the frontend. @gengh , do you know what a Boolean looks like when neither of the radio buttons has been selected? Is it

{
    "Z1K1": "Z40",
    "Z40K1": ""
}

? Or something else?

Ah! I see. I was running it with all of the Boolean argument values set.

It doesn’t matter, only inputs 1 and 2 are mapped. I changed it deliberately to confirm that it is a problem with the mapping rather than the Composition itself. An earlier version maps them correctly and still manifests the error. https://www.wikifunctions.org/wiki/Z14717?uselang=en&oldid=95554

Current version

IMG_0922.png (2×960 px, 272 KB)

Original version

IMG_0923.png (2×960 px, 310 KB)

I am trying to figure out whether this is a scoping issue in the orchestrator or a problem with the composition-based implementation itself. I'm running this locally and logging all the nested function calls. At one point, I see this:

{'name': 'Z12684K1',
 'argument': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
   'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
   'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
  'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
   'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K1'}},
  'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
    'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
    'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
   'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
    'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K1'}},
   'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
     'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
     'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
    'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
     'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K1'}},
    'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
      'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
      'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
     'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
      'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K2'}},
     'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
       'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
       'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
      'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
       'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K1'}},
      'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
        'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
        'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
       'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
        'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K1'}},
       'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
         'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
         'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
        'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
         'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K1'}},
        'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
          'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
          'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}},
         'K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z18'},
          'Z18K1': {'Z1K1': 'Z6', 'Z6K1': 'Z11849K1'}},
         'K2': {'Z1K1': {'Z1K1': {'Z1K1': 'Z9', 'Z9K1': 'Z7'},
           'Z7K1': {'Z1K1': 'Z9', 'Z9K1': 'Z881'},
           'Z881K1': {'Z1K1': 'Z9', 'Z9K1': 'Z40'}}}}}}}}}}}}

There is a function that gets called with a list of 8 Booleans. All of them are references to Z11849K1 except for the fourth, which is set to Z11849K2. This seems strange--I would have expected references to Z11849K1-8.

I can keep digging next week to see if this is due to the orchestrator's scoping, but I wanted to see if you were familiar with this implementation and maybe had any ideas.

Yes, it is strange. When https://www.wikifunctions.org/wiki/Z14717?uselang=en&oldid=95554 (which is mapped as you would expect) produced erroneous results, I changed the composition so that all eight elements were mapped from the first argument (set to True). Then I set the second argument to False and tried changing the mapping for each element in turn. This confirmed that when its value was mapped into any of the first three elements, the implementation evaluated correctly to False, but if its value was mapped to any element from the fourth to the eighth, the implementation evaluated incorrectly to True.

Sorry, it seems I provided the wrong link to https://www.wikifunctions.org/view/en/Z14718 in the initial report. I created this tester to call Z12684 (are all True) with a Typed list of Booleans in which the fourth element is False. Its call correctly evaluates to False. From the JSON provided above, it looks like that is exactly what is about to happen here, because Z11849K1 is/should be True and Z11849K2 is/should be False.

Please feel free to revert to https://www.wikifunctions.org/wiki/Z14717?uselang=en&oldid=95554 at any time. I’d do it myself, but I don’t want to add to the confusion.

I created a comparable error with a sandbox implementation here: https://www.wikifunctions.org/view/en/Z15106.

IMG_0926.png (2×960 px, 270 KB)

IMG_0927.png (2×960 px, 232 KB)

Somehow, arguments after the third are not resolved and are returned as Z18s in a reversed list of Strings.

GrounderUK renamed this task from Fourth and subsequent Argument reference maps incorrectly to Fourth and subsequent Argument references not resolved.Apr 6 2024, 1:53 PM

So I created a sandbox composition with echo, and this works correctly. https://www.wikifunctions.org/view/en/Z15160

That’s a built-in, of course, (with alternative implementations disconnected) whereas the initial reversing implementation might be Python or JavaScript. I created similar echo compositions using:

  1. a function with a single implementation, in JavaScript: https://www.wikifunctions.org/view/en/Z15355 and
  2. a function with a single implementation, in Python: https://www.wikifunctions.org/view/en/Z15364

In both these cases (unlike the built-in echo) arguments 4, 5, and 6 are unresolved in the returned list. I hope that helps with pinpointing the problem.

Hmm, okay. So what are the ZIDs of a function and implementation that should currently work but don't? How can I reproduce the bug right now?

Hmm, okay. So what are the ZIDs of a function and implementation that should currently work but don't? How can I reproduce the bug right now?

Function Z15104 has two failing implementations: Z15355 and Z15364

…compositions using:

  1. a function with a single implementation, in JavaScript: https://www.wikifunctions.org/view/en/Z15355 and
  2. a function with a single implementation, in Python: https://www.wikifunctions.org/view/en/Z15364

https://www.wikifunctions.org/view/en/Z15104

Change #1020837 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator 2024-04-04-132719 to 2024-04-17-125039

https://gerrit.wikimedia.org/r/1020837

Change #1020837 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator 2024-04-04-132719 to 2024-04-17-125039

https://gerrit.wikimedia.org/r/1020837