Skip to content

visualizer: fix: read the dy parameter of PacketDropCanvasVisualizer - #1356

Open
adamgeorge309 wants to merge 1 commit into
masterfrom
topic/gy/packetdrop-visualizer-dy
Open

adamgeorge309 wants to merge 1 commit into
masterfrom
topic/gy/packetdrop-visualizer-dy

Conversation

@adamgeorge309

Copy link
Copy Markdown
Contributor

PacketDropCanvasVisualizer::initialize() read the dx parameter into both dx and dy, so dy had no effect and the packet drop animation turned over at the height dx, 32 pixels with the defaults instead of the documented 64. It now reads dy from the dy parameter.

Risk: every canvas packet drop animation changes shape; with the defaults the icon rises 64 pixels instead of 32 before it falls, and falls twice as far. Videos of packet drops in showcase pages show the lower arc until they are re-recorded. Simulation results and the fingerprints recorded in tests/fingerprint do not change.

Closes #1355

One commit: visualizer: fix: read the dy parameter of PacketDropCanvasVisualizer.

The problem

src/inet/visualizer/canvas/common/PacketDropCanvasVisualizer.cc:36-37 on master:

dx = par("dx");
dy = par("dx");

The Network Description (NED) file declares double dx = default(32); // Specifies how far the animation turns over along the X axis and double dy = default(64); // Specifies how far the animation turns over along the Y axis. setAlpha() (lines 93-96) moves the icon along py = a * px * px + b * px with a = dy / -(dx * dx) and b = -2 * a * dx, whose turning point is at (dx, dy). The line dates from 2525087caf (2017).

No C++ interface, NED parameter, message field or feature descriptor changes.

Verification

The canvas figure fingerprint (ingredient f) of Cmdenv's fake graphical user interface, which hashes every canvas figure after each refreshDisplay(), observes the icon position when the fade-out runs on simulation time:

cd showcases/visualizer/canvas/packetdrop
inet -u Cmdenv -c QueueOverflow -r 0 --cmdenv-express-mode=true \
  --cmdenv-fake-gui=true --cmdenv-fake-gui-after-event-probability=1 \
  '--**.fadeOutMode="simulationTime"' --fingerprint=0000-0000/f \
  [--**.packetDropVisualizer**.dy=1]
dy Master This change
default (64) 4c5c-59b9 4e12-6fb1
1 4c5c-59b9 8d09-09a9

tests/fingerprint does not see the change. Its fake graphical user interface runs (ingredients tyf: simulation time, display strings, canvas figures) set fadeOutMode to animationTime. The 22 tyf rows of the five showcases that display packet drops (canvas/packetdrop ×5, coexistence WpanHosts ×8, gptpandtas ×4, analogmodel ×3, of which Routing displays none, tokenbucket ×2), run with ./fingerprinttest -s -f tyf -m 'gptpandtas|tokenbucket|analogmodel|coexistence|canvas/packetdrop', compute the same fingerprints on master and with this change; 14 of them do not match their recorded values on master either. The reproduction command with fadeOutMode set to animationTime gives 97fc-2bf8 for both dy values with this change. No test is added; a test would have to record a figure fingerprint that depends on simulation-time fade-out. The 3D visualizer PacketDropOsgVisualizer does not use these parameters.

Release build (make MODE=release in the root and tests/module/lib), each suite run on master bba1db4c81 and with this change:

Command Master This change
tests/fingerprint: ./fingerprinttest -s -F tyf 1774 run, 5 failures, 62 errors, 1 expected error the same failing and erroring rows, with the same computed fingerprints
tests/fingerprint: ./fingerprinttest -s -m 'canvas/packetdrop', every ingredient 5 run; QueueOverflow fails on tyf (b74a-11e9, recorded dee8-a7c2) the same, with the same computed fingerprints
tests/module: inet_run_module_tests -m release --no-build -l ERROR 657 run, 368 pass, 289 fail 369 pass, 288 fail: the same failing tests by name, except Polyhedron_5, which failed once on master and passed in 3 reruns of master

Of the 289 module failures on master, 274 are tcp_* tests and 15 are ConvolutionalCoder12, ConvolutionalCoder34, DimensionalMediumAnalogModel_PrintAttenuation_1, EtherHost_lifecycle, ExternalProcess_3, Ieee80211BitDomain, Ieee80211SymbolDomain, Ieee8021d-Rstp, Ieee8021d-Stp, IPv6_packet_too_big, LogNormalShadowing_Correlated_4, MIPv6_tcp_handover, PacketGate_1, Polyhedron_5, UDPSocket_1. The 5 fingerprint failures are rows of mipv6-refactoring.csv whose recorded ~tNlb fingerprints are stale on master; the 62 errors are configurations whose optional features are not built.

Gates: check-pull-request.sh --base origin/master (commits, classification, includes, NED parameters, description), check-source-seals.sh --base origin/master and check-architecture.sh src/inet/visualizer pass.

Relationship to other pull requests

#1322, #1324, #1326, #1328, #1334, #1337, #1340 and #1342 also add an entry under "Notable bug fixes" in WHATSNEW; whichever merges later renumbers.

PacketDropCanvasVisualizer::initialize() read the dx parameter into both dx and dy, so the dy parameter had no effect, and the drop animation turned over at the height dx: 32 pixels with the defaults instead of the documented 64. setAlpha() moves the icon along a parabola whose turning point is at (dx, dy), as the Network Description (NED) comments of the two parameters say. The line dates from 2525087.

initialize() now reads dy from the dy parameter. Every canvas packet drop animation turns over at dy, 64 pixels with the defaults. Simulation results do not change: setAlpha() uses the value only to place the figure, during refreshDisplay(). In a run with Cmdenv's fake graphical user interface and fadeOutMode set to simulationTime, the canvas figure fingerprint (ingredient f) of showcases/visualizer/canvas/packetdrop QueueOverflow is the same for dy = 64 and dy = 1 before this commit and differs after it. The fingerprints recorded in tests/fingerprint do not change: their fake graphical user interface runs (ingredients tyf: simulation time, display strings, canvas figures) set fadeOutMode to animationTime, and the 22 tyf rows of the five showcases that display packet drops compute the same fingerprints before and after this commit.

Change: src.visualizer.canvas.PacketDropCanvasVisualizer | behavior.change.fix | whatsnew

This branch has not been deployed

No deployments
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.

visualizer: PacketDropCanvasVisualizer reads dx into dy, so the dy parameter has no effect

1 participant